vinumpillai
New member
- Joined
- May 25, 2018
- Messages
- 4
- Programming Experience
- 1-3
Gurus,
I have a c# windows form application. There is a PictureBox within a Panel. An image is loaded in the PictureBox. I want the image to be zoomed the area user selects. The user will select by dragging using the left mouse button. What i did is on the mouse down event, i saved the x/y in a variable and in mouse move event i am drawing the rectangle plus i am recording the x/y of the current position in another variable. And in mouse up event, i create a rectangle of the size of the selection made. And i create a bitmap using the rectangle's width and height. Then I created a graphics object using the created bitmap. Then i use the DrawImage function to draw the image to the bitmap created and assigned to the PictureBox. But it always takes the x/y coordinates from 0,0.
Please help
Vinu
I have a c# windows form application. There is a PictureBox within a Panel. An image is loaded in the PictureBox. I want the image to be zoomed the area user selects. The user will select by dragging using the left mouse button. What i did is on the mouse down event, i saved the x/y in a variable and in mouse move event i am drawing the rectangle plus i am recording the x/y of the current position in another variable. And in mouse up event, i create a rectangle of the size of the selection made. And i create a bitmap using the rectangle's width and height. Then I created a graphics object using the created bitmap. Then i use the DrawImage function to draw the image to the bitmap created and assigned to the PictureBox. But it always takes the x/y coordinates from 0,0.
Please help
Vinu