- 性别
- 保密
- 积分
- 0
- 积分
- 10
- 精华
- 0
- 阅读权限
- 10
- 注册时间
- 2013-10-4
- 最后登录
- 2013-10-6
- 帖子
- 5
- 性别
- 保密
|
本帖最后由 sky_yx 于 2015-12-30 14:20 编辑
区域找图代码类:摘自 神罗模块QQ447186060[转载请注明]
Function 找色_区域找色(左上角x As Integer, 左上角y As Integer, 右下角x As Integer, 右下角y As Integer, 十进制原色 As Long) As String '成功返回坐标(111,111)或失败反回空字符串
Dim a As Long, b As Long, X1%, Y1%
找色_区域找色 = ""
For Y1 = 左上角y To 右下角y
For X1 = 左上角x To 右下角x
a = GetDC(0)
b = GetPixel(a, X1, Y1) '坐标
If b = 十进制原色 Then '14215660 Then '十进制原色(把16进制转换成10进制)
找色_区域找色 = X1 & "," & Y1
Exit Function
End If
Call ReleaseDC(0, a) '释放
Next
Next
End Function
|
|