0

I'm trying to crop an image:

Bitmap bmp = (Bitmap)pictureBox1.Image;
Bitmap cBmp = bmp.Clone(croppedAreaRectangle, bmp.PixelFormat);
pictureBox1.Image = cBmp;
bmp.Dispose();

It's partly working, but the image result is smaller, and from a different area out side the selected cropped area.


So what's wrong?

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by Diamonddrake
0

the image returned will be the same size as the rectangle it was cropped from, not the original image, as for any other problem. you might want to look at how the cropping rectangle is created.

The code you have posted looks sound, there is no reason why it shouldn't work, aside from the croppedAreaRectangle. that's probably where the problem is.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.