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
Printable View
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
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