|
-
May 29th, 2000, 07:51 AM
#1
this isnt really about bitblt, but, I am making a paint program.
I want to get the coord of the mouse, INSIDE the picturebox, I already know how to blit the image to it... I just need to know how to get the coord's of the mouse inside the picbox
-
May 29th, 2000, 05:33 PM
#2
Frenzied Member
what exactly do you mean?
you can use getCursorPos and ScreenToClient to get the current mouse position
Code:
Private Type POINTAPI
x As Long
y As Long
End Type
Private Declare Function GetCursorPos Lib "user32" Alias "GetCursorPos" (lpPoint As POINTAPI) As Long
Private Declare Function ScreenToClient Lib "user32" Alias "ScreenToClient" (ByVal hwnd As Long, lpPoint As POINTAPI) As Long
Private Sub Picture1_Click()
Dim apiMousePos As POINTAPI
'Get the mouse position on the screen
GetCursorPos apiMousePos
'translate to PBox Coords
ScreenToClient Picture1.hWnd, apiMousePos
MsgBox apiMousePos.X & "," & apiMousePos.Y
End Sub
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
|