Advertisement
Guest User

Untitled

a guest
Jul 10th, 2014
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. Rectangle sourceRect = new Rectangle(iX1, iY1, w, h);
  2. System.Drawing.Image imgNew = CropImage(imgOrig, sourceRect);
  3. private static System.Drawing.Image CropImage(System.Drawing.Image img, Rectangle cropArea)
  4. {
  5. Bitmap bmpImage = new Bitmap(img);
  6. Bitmap bmpCrop = bmpImage.Clone(cropArea, bmpImage.PixelFormat);
  7. img.Dispose();
  8. return (System.Drawing.Image)bmpCrop;
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement