public SwiftBitmap Crop(int Width, int Height, Align VAlignment, Align HAlignment)
{
Contract.Requires<NullReferenceException>(InternalBitmap != null);
Unlock();
var TempRectangle = new System.Drawing.Rectangle();
TempRectangle.Height = Height;
TempRectangle.Width = Width;
TempRectangle.Y = VAlignment == Align.Top ? 0 : this.Height - Height;
if (TempRectangle.Y < 0)
TempRectangle.Y = 0;
TempRectangle.X = HAlignment == Align.Left ? 0 : this.Width - Width;
if (TempRectangle.X < 0)
TempRectangle.X = 0;
var TempHolder = InternalBitmap.Clone(TempRectangle, InternalBitmap.PixelFormat);
InternalBitmap.Dispose();
InternalBitmap = TempHolder;
this.Width = Width;
this.Height = Height;
return this;
}