Results 1 to 3 of 3

Thread: Scroll Bar zoom HELP!

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2008
    Posts
    23

    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.

  2. #2
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: Scroll Bar zoom HELP!

    Wrong Forum post in the VB 6.0 section:

    http://www.vbforums.com/forumdisplay.php?f=1
    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

  3. #3
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    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
  •  



Click Here to Expand Forum to Full Width