-
Feb 23rd, 2018, 01:06 PM
#1
Thread Starter
New Member
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
-
Feb 24th, 2018, 07:01 AM
#2
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
-
Feb 24th, 2018, 10:01 AM
#3
Thread Starter
New Member
Re: Picturebox with zoom, need a mouse drag option
Originally Posted by boops boops
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|