Option Explicit
Private Const SRCCOPY = &HCC0020
Private Type POINTAPI
X As Long
Y As Long
End Type
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Declare Function GetDesktopWindow Lib "user32" () As Long
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC 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 dwRop As Long) As Long
Dim hDCScreen As Long, pa As POINTAPI
Dim tW As Long, tH As Long, tWD As Long, tHD As Long
Dim bState As Boolean
Private Sub Command1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
hDCScreen = GetDC(GetDesktopWindow())
tH = Picture1.ScaleHeight: tHD = tH / 2
tW = Picture1.ScaleWidth: tWD = tW / 2
bState = True
End Sub
Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If bState Then
GetCursorPos pa
BitBlt Picture1.hdc, 0, 0, tW, tH, hDCScreen, pa.X - tWD, pa.Y - tHD, SRCCOPY
End If
End Sub
Private Sub Command1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
bState = False
End Sub
Нарисовать ее в фотошопе (или генерировать динамически) и просто присвоить картинку форме, которую можно будет, например, таскать мышкой.iGrok писал(а):З.Ы. А вот как рамку наприсовать - я не знаю.
1Steps писал(а):
- Код: Выделить всё
Graphics.CopyFromScreen(...)
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 69