- Option Explicit
-
- Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
- Private Declare Function GetWindowDC Lib "user32" (ByVal HWnd As Long) As Long
- Private Declare Function StretchBlt Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal dwRop As Long) As Long
-
- Private Type POINTAPI
- X As Long
- Y As Long
- End Type
-
- Dim Pt As POINTAPI
-
- Private Sub Timer1_Timer()
-
- GetCursorPos Pt
- StretchBlt Picture1.hdc, 0, 0, Picture1.Width / Screen.TwipsPerPixelX, Picture1.Height / Screen.TwipsPerPixelY, GetWindowDC(0), Pt.X - 15, Pt.Y - 15, 30, 30, &HCC0020
-
- End Sub
Option Explicit
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Declare Function GetWindowDC Lib "user32" (ByVal HWnd As Long) As Long
Private Declare Function StretchBlt Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal dwRop As Long) As Long
Private Type POINTAPI
X As Long
Y As Long
End Type
Dim Pt As POINTAPI
Private Sub Timer1_Timer()
GetCursorPos Pt
StretchBlt Picture1.hdc, 0, 0, Picture1.Width / Screen.TwipsPerPixelX, Picture1.Height / Screen.TwipsPerPixelY, GetWindowDC(0), Pt.X - 15, Pt.Y - 15, 30, 30, &HCC0020
End Sub