首先使用GetCursorpos函数的到鼠标的位置
在使用getpixel函数即可得到鼠标所指象素的颜色值!
在使用getpixel函数即可得到鼠标所指象素的颜色值!
解决方案 »
- VB 中保存文件的格式到数据库
- 新手问题 关于Excel批量新建工作表的问题。
- 为什么没有保存?
- 实时错误'-2147217843(80040e4d)'
- 关于字串的提取!
- 如果用API函数得到win2000安装的版本(Advance Server、Server、Profession)?
- 在VB中adodc 和 adodb有什末区别?
- *****如何判断已经开始事务了*****
- 对listview按列排序时如何使之按数字顺序排序?
- 如何在运行中隐藏listview控件。
- Microsoft.Jet.OLEDB.3.51"与"Microsoft.Jet.OLEDB.4.0如何判断
- 用程序如何模拟鼠标的移动、点击?
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Type POINTAPI
x As Long
y As Long
End Type
Private Declare Function GetDesktopWindow Lib "user32" () As Long
Private Declare Function GetWindowDC Lib "user32" (ByVal hwnd As Long) As LongPrivate Sub Timer1_Timer()
Dim p As POINTAPI
Dim d As Long
Dim dd As Long
Dim l As Long
GetCursorPos p
d = GetDesktopWindow()
dd = GetWindowDC(d)
l = GetPixel(dd, p.x, p.y)
Picture1.BackColor = l
End Sub