0
Answer

How to crop PictureBox Image when Stretched?

chong kar kit

chong kar kit

16y
7.6k
1

Hi,

I'm currently developing a c# windows application program which allows me to crop certain part of the image when i select it. But if I got a bigger image than the currently picturebox height and width(e.g. picturebox size(400,300) Image opened size(700,300), I tried to use the StretchedImage property to make it fit into the picturebox but when i crop it crops the original size of the image not the image in the picturebox when I use

Bitmap previewImg = newImg.Clone(rect, initialImg.PixelFormat);

my rect is the rectangle that i selected using Mouse Down and Mouse Up events. Hope I could get some help on this thanks =)..