|
-
Nov 17th, 1999, 10:48 AM
#1
Thread Starter
Lively Member
how can i drag a blit'd bitmap around a form?
-
Nov 18th, 1999, 01:18 AM
#2
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]
-
Nov 18th, 1999, 10:36 AM
#3
Thread Starter
Lively Member
let me make my question more specific...
the picture is blit'd on the form.
-
Nov 18th, 1999, 02:46 PM
#4
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]
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
|