Nihal Ahmed

Nihal Ahmed

  • 1.5k
  • 96
  • 19.8k

Crop Image in C#

Dec 31 2013 5:35 AM
Hi,
 
I am working on image processing. I want to crop the image. I have written code  like/*********
 
Bitmap bmp = image as Bitmap;
// Check if it is a bitmap:
if (bmp == null)
throw new ArgumentException(" image in null");
// Crop the image:
Bitmap cropBmp = bmp.Clone(selection, bmp.PixelFormat);
// Release the resources:
image.Dispose();
bmp.Dispose();
return cropBmp;
 
***********/ 
when i am run cropping, Its give the error  : Out of Memory..Please help me. 
 
 

Answers (5)