胆囊收缩素哪里买:vb6里的“屏幕读点语句”是什么

来源:百度文库 编辑:高考问答 时间:2024/05/02 01:20:59
VB6里有没有关于读取显示屏的点的坐标和颜色的语句啊?

Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long

hdc 设备场景句柄 通过 getdc(0)获得屏幕句柄
x 横向像素坐标
y 纵向像素坐标

例如:

Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Sub Command1_Click()
Me.ScaleMode = 3
Dim i, j, hdc
hdc = GetDC(0)
For i = 0 To 100
For j = 0 To 100
Me.PSet (i, j), GetPixel(hdc, i, j)
Next
Next
End Sub

API Getpixel()