How can control a large image (larget than 1024*768) by two scrollbars ?
Printable View
How can control a large image (larget than 1024*768) by two scrollbars ?
Place a picturebox, and place an another picturebox inside the first picbox.
You just have to set the scrollbar's Max value (at when you load the picture); to the size, that will never move your picture out of the boundaries.
Now, you can move the scrollbar.Code:Picture2.AutoSize = True 'Let the picturebox to resize itself to fit the image.
Picture2.Top = 0 'move to the 0.
Set Picture2.Picture = LoadPicture("C:\mypic.bmp") 'load the image
VScroll1.Value = 0
VScroll1.Max = Picture2.ScaleHeight - Picture1.ScaleHeight 'set the scrollbar size
Code:Private Sub VScroll1_Scroll()
Picture2.Top = -VScroll1.Value
End Sub
Very easy ... :eek:
THANKS ! ;)
Sure thing :)
Just dont forget to set the tread as Resolved, if your problem is gone. Go up to thread tools menu, here in this thread, and select Mark thread as resolved, that helps to the others to find a solution.