01-03-2005, 08:50 AM
I drew my picture in picture box and I zoomed in and zoomed out it. Bou when I zoomed in this picture, I can not see the whole zoomed picture. I want to move mouse to look over whole zoomed picture ( like .pdf). Can you give me some suggestion and some source code?
01-03-2005, 01:07 PM
How do you zoom in, and zoom out?
If you use the Search Button at the top of the page (next to the FAQ button), and look
for something like ZOOM and SCROLL, you may find the answer yourself.
The answer will probably depend on how you are implementing your zoom.
01-03-2005, 09:50 PM
I am also a little confused by your saying "look over whole zoomed picture"...
Besides searching for "zoom scroll" you can also try searching for "zoom pan".
There's a nice "Zoom and Pan Demo" at the bottom of this page:
01-04-2005, 05:53 AM
I hope he means picture panning?
If it is, i'll give you a hint:
This works only if you draw the complete image on a fairly large picture box and it resides in a form or another picture box.
First on the pic_mousedown event store the x and y coordinates in a variable.
in the mousemove event check for the x and y coordinates, then find the horizontal and vertical displacements and move the picturebox. (When doing this check the mouse coordinates using getcursorpos function, not the X and Y arguments of the event, since we are moving the whole picbox each time!).
There is another option to do this; it is to use scrollbars to enable scrolling of your picbox.
01-04-2005, 08:01 PM
Thanks. But I confuse it. i don't know how to do. I drew my picture by usinf lines, labels and shape on picture box. After I zoomed in my picture some parts of my picture is out of picture box. Can you suggest me how to do. I want to look or see every part of zoomed picture. I must finish it on time. I hope you can help me. Please help me.
01-05-2005, 08:02 AM
First before zooming the contents of the picturebox, calculate the width and height of the zoomed image and resize the picturebox fit to the contents.
Now the picturebox (lets call it 'the canvas') is enlarged but due to the limited size of the parent form or parent picturebox, we can't see the entire contents of the canvas.
Then the rest is easy, if you want to see the top-left part of the 'large' canvas, move the canvas to 0,0.
If you want to see the right-bottom part, it will be..
piccanvas.move piccanvas.width-parentpicbox.scalewidth , piccanvas.height-parentpicbox.scaleheight
Hope this will help you out..