I want to implement zoom for an image. I don't want to resize the PictureBox, but the image itself.
How do I do this?
Adjust the magnification: Double-tap the screen with three fingers (without lifting your fingers after the second tap), then drag up or down. Or triple-tap with three fingers, then drag the Zoom Level slider. Move the Zoom lens: (Window Zoom) Drag the handle at the bottom of the Zoom lens.
The Zoom Tool is used to zoom in and out of an image.
One solution is:
PictureBox
Another way is to simple create a new bitmap instance like that:
Size newSize = new Size((int)(originalBitmap.Width * zoomFactor), (int)(originalBitmap.Height * zoomFactor));
Bitmap bmp = new Bitmap(originalBitmap, newSize);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With