|
-
Feb 12th, 2009, 03:52 PM
#1
Thread Starter
Junior Member
Scroll Bar zoom HELP!
Hi. I am drawing lines in a picture box using a draw function picture1.line and and trying to zoom in on the picture box using a vertical scroll bar.
I am going to use the scroll bar to change the scale of the picture i.e
picture1.scale. At present my my scale is
picture1.scale (-350 / 2.5, 340 / 2.5)-(350 / 2.5, 340 / 2.5)
My code for the scroll bar so far is
Private Sub VScroll_Chang ()
Dim SmallChange As String
Dim LargeChange As String
SmallChange = 2
LargeChange = 5
If VScroll = LargeChange Then
Picture1.Scale (-350 / LargeChange, 340 / LargeChange)-(350 / LargeChange, 340 / LargeChange)
ElseIf VScroll = SmallChange Then
Picture1.Scale (-350 / SmallChange, 340 / SmallChange)-(350 / SmallChange, 340 / SmallChange)
End If
End Sub
Can anyone help as it does nothing when I move the scrollbar?
Basically the picturebox is taking points from an array and drawing them in the picturebox.
-
Feb 13th, 2009, 04:19 AM
#2
Re: Scroll Bar zoom HELP!
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Feb 13th, 2009, 06:12 AM
#3
Re: Scroll Bar zoom HELP!
Thread moved from CodeBank forum (which is for you to post your code examples, not questions)
If you look at the help for .Scale you will see that it is not related to what you are trying to do - what it does is re-define the coordinate system (which affects the position of things you do until you next set the .Scale).
To zoom either re-draw everything (with sizes/positions altered appropriately), or create a second picturebox and use .PaintPicture to copy at the size you want.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|