how can i drag a blit'd bitmap around a form?
Printable View
how can i drag a blit'd bitmap around a form?
Move the PictureboxControl you BitBlt'd the Image onto, eg.
------------------Code:Private oX As Single
Private oY As Single
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
oX = X
oY = Y
End If
End Sub
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Static lX As Single
Static lY As Single
If Button = vbLeftButton And (lX <> Y Or lY <> Y) Then
Picture1.Move Picture1.Left + X - oX, Picture1.Top + Y - oY
lX = X
lY = Y
End If
End Sub
Aaron Young
Analyst Programmer
[email protected]
[email protected]
let me make my question more specific...
the picture is blit'd on the form.
I would suggest adding a Picturebox to the Form and BitBlt'ing the Image into the Picturebox, so you can use the Code I posted.
Otherwise you'll have to check the Coords of the Mouse to see if it's in the Area of the Image, then Clear and Redraw the Image in its New Location as the User Drags the Mouse.
Most Likely resulting in a bad Flickering effect.
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]