vb 寻找某点颜色的坐标?
1个回答
展开全部
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function ReleaseDC Lib "user32" (ByVal hwnd As Long, ByVal hdc As Long) As Long
Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long
Private Sub Command1_Click()
h = GetDC(0) '取得整个屏幕的DC
dim x,y
for x=0 to 1028
for y=0 to 1024
Colr = GetPixel(h, x, y) '取颜色
ReleaseDC 0, hdc '释放hDC
If Colr = &Hffffff Then print x & "," & y
next y
next x
End Sub
Private Declare Function ReleaseDC Lib "user32" (ByVal hwnd As Long, ByVal hdc As Long) As Long
Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long
Private Sub Command1_Click()
h = GetDC(0) '取得整个屏幕的DC
dim x,y
for x=0 to 1028
for y=0 to 1024
Colr = GetPixel(h, x, y) '取颜色
ReleaseDC 0, hdc '释放hDC
If Colr = &Hffffff Then print x & "," & y
next y
next x
End Sub
ZESTRON
2024-09-04 广告
2024-09-04 广告
在Dr. O.K. Wack Chemie GmbH,我们高度重视ZESTRON的表界面分析技术。该技术通过深入研究材料表面与界面的性质,为提升产品质量与可靠性提供了有力支持。ZESTRON的表界面分析不仅涵盖了相变化、化学反应、吸附与解吸...
点击进入详情页
本回答由ZESTRON提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询