![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Hobbyist Programmer
Join Date: Jan 2005
Posts: 110
Rep Power: 4
![]() |
picturebox scroll bars ;)
well i added an image to my dialog (inside a picturebox)
and added scroll bars (H and V) and when i have a picture and scroll the bar it doest scroll through the whole picture. code: Private Sub Command12_Click() CommonDialog1.DialogTitle = "Load Picture" CommonDialog1.InitDir = App.Path & "\Images" CommonDialog1.Filter = "Bitmaps (*.bmp)|*.bmp|Jpegs (*.jpg)|*.jpg|Gifs (*.gif)|*.gif" CommonDialog1.ShowOpen Image1.Picture = LoadPicture(CommonDialog1.FileName) HScroll1.Max = Picture7.ScaleWidth VScroll1.Max = Picture7.ScaleHeight End Sub Private Sub VScroll1_Change() Call Image1.Move(Image1.Left, -(VScroll1.Value)) End Sub Private Sub HScroll1_Change() Call Image1.Move(Image1.Top, -HScroll1.Value) End Sub also if the image is smaller than the picture box id like it to be centered in the picture box and the scroll bars to be disabled please help me out here thanks alot ![]() |
|
|
|
|
|
#2 |
|
Hobbyist Programmer
Join Date: Jan 2005
Posts: 110
Rep Power: 4
![]() |
nevermind now
i managed to find a cool control that does the auto scrolling (and works great) ![]() |
|
|
|
|
|
#3 | |
|
Programmer
Join Date: Feb 2005
Posts: 62
Rep Power: 4
![]() |
Quote:
i'm ressurrecting this topic because i am trying to do the same thing. i've got an image that displays in a picturebox according to whatever the user selects in a dirlistbox, but most of the images that get selected and displayed are 3-4x as large as the picturebox. based on my research, microsoft hasn't implemented any useful image controls in even the newest versions of VB. i'm using VB6 by the way. is there any way to allow the user to "grab" and pan the image within the box like you can "grab" and pan a .pdf document? or at least is there some relatively easy way of installing scrollbars to do the same? i tried modifying this guy's (broken?) code but couldn't get it to work. thanks Last edited by chepfaust; Feb 18th, 2005 at 1:18 PM. |
|
|
|
|
|
|
#4 |
|
Hobbyist Programmer
Join Date: Jan 2005
Posts: 110
Rep Power: 4
![]() |
hey ^^
heres a link to the ocx http://vegetasan.websiteallies.com/%.../ASPicture.zip im not sure about the image grabbing but the scroll bars work really well maybe you can use the mouse move event and check if the mouse button is pressed down. then use the windows properties to move it. good luck ![]() |
|
|
|
|
|
#5 | |
|
Programmer
Join Date: Feb 2005
Posts: 62
Rep Power: 4
![]() |
Quote:
![]() |
|
|
|
|
|
|
#6 |
|
Hobbyist Programmer
Join Date: Jan 2005
Posts: 110
Rep Power: 4
![]() |
np ^^
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|