Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) 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 GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Type POINTAPI
x As Long
y As Long
End Type
Dim xy As POINTAPI
Dim a, b
Private Sub Timer1_Timer()
'a = GetDesktopWindow()
b = GetDC(0)
GetCursorPos xy
Label1.Caption = GetPixel(b, xy.x, xy.y)
End Sub
'***************
为什么这样的到GetPixel的返回值不是在0-255之间。
谢谢拉~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Private Declare Function GetDesktopWindow Lib "user32" () As Long
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Type POINTAPI
x As Long
y As Long
End Type
Dim xy As POINTAPI
Dim a, b
Private Sub Timer1_Timer()
'a = GetDesktopWindow()
b = GetDC(0)
GetCursorPos xy
Label1.Caption = GetPixel(b, xy.x, xy.y)
End Sub
'***************
为什么这样的到GetPixel的返回值不是在0-255之间。
谢谢拉~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~