How to move, zoom in-out a picturebox runtime?

unique.suren

New member
Joined
Nov 14, 2011
Messages
1
Location
Jaipur
Programming Experience
5-10
Hi,
How i can move,zoom in-out the picturebox during runtime on a form or groupbox? If anybody can provide me code...i'll be very grateful to him/her...
Thanx in advance...
 

jmcilhinney

VB.NET Forum Moderator
Staff member
Joined
Aug 17, 2004
Messages
14,579
Location
Sydney, Australia
Programming Experience
10+
You pretty much can't. You need to think a bit laterally. Add a Panel to your form and set its Size to whatever area you want the user to see of the picture. Add a PictureBox to that Panel and set its SizeMode to Zoom. When you load an Image into the PictureBox, set its Size appropriately to just accommodate the whole thing. You can now change the Top and Left of the PictureBox to pan and the Size to zoom.
 
Top Bottom