dcsimg
Results 1 to 3 of 3
  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2018
    Posts
    10

    Lightbulb Picturebox with zoom, need a mouse drag option

    Hi there

    I need som guidence to a problem ive got


    I have a picturebox with a loaded image

    i have a mouse zoom function with is this
    Private Sub PictureBox_MouseWheel(sender As System.Object,
    e As MouseEventArgs) Handles PictureBox1.MouseWheel
    If e.Delta <> 0 Then
    If e.Delta <= 0 Then
    If PictureBox1.Width < 500 Then Exit Sub 'minimum 500?
    Else
    If PictureBox1.Width > 2000 Then Exit Sub 'maximum 2000?
    End If

    PictureBox1.Width += CInt(PictureBox1.Width * e.Delta / 1000)
    PictureBox1.Height += CInt(PictureBox1.Height * e.Delta / 1000)
    End If

    End Sub
    Its all good and works ok, BUT i cant focus on what i zoom in to, i would like a function so i can "grab" the image with my mouse and drag to the desire location of the image i have zoomed in on.

    Any suggestions ?

    Thanks

  2. #2
    PowerPoster boops boops's Avatar
    Join Date
    Nov 2008
    Location
    Holland/France
    Posts
    3,009

    Re: Picturebox with zoom, need a mouse drag option

    See the ZoomPictureBox in my signature below. It does exactly what you are asking. If you need help with it, you can post a question to that thread in the VB.Net CodeBank. BB

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2018
    Posts
    10

    Re: Picturebox with zoom, need a mouse drag option

    Quote Originally Posted by boops boops View Post
    See the ZoomPictureBox in my signature below. It does exactly what you are asking. If you need help with it, you can post a question to that thread in the VB.Net CodeBank. BB
    Thanks looks awesome, a little bit advanced for me to implant just yet, but will try to get the hand of of it in time

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width


×
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.