How to crop an image using C#?

sandy101 picture sandy101 · Apr 9, 2009 · Viewed 267.4k times · Source

How can I write an application that will crop images in C#?

Answer

Nick picture Nick · Apr 9, 2009

Check out this link: http://www.switchonthecode.com/tutorials/csharp-tutorial-image-editing-saving-cropping-and-resizing

private static Image cropImage(Image img, Rectangle cropArea)
{
   Bitmap bmpImage = new Bitmap(img);
   return bmpImage.Clone(cropArea, bmpImage.PixelFormat);
}