public SwiftBitmap ApplyColorMatrix(System.Drawing.Imaging.ColorMatrix matrix)
{
Contract.Requires<ArgumentNullException>(matrix != null);
Contract.Requires<NullReferenceException>(InternalBitmap != null);
Unlock();
using (Graphics NewGraphics = Graphics.FromImage(InternalBitmap))
{
using (ImageAttributes Attributes = new ImageAttributes())
{
Attributes.SetColorMatrix(matrix);
NewGraphics.DrawImage(InternalBitmap,
new System.Drawing.Rectangle(0, 0, Width, Height),
0, 0, Width, Height,
GraphicsUnit.Pixel,
Attributes);
}
}
return this;
}