为什么用PixelGetColor获取的颜色值与我设置的不一样?[已解决]
本帖最后由 penguinl 于 2015-3-4 18:03 编辑#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <WinAPIGdi.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 117, 78, 192, 124)
$Label1 = GUICtrlCreateLabel("", 0, 0, 16, 16, BitOR($SS_CENTER,$SS_CENTERIMAGE))
GUICtrlSetFont(-1, 5, 400, 0, "MS Sans Serif")
;~ GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, 0x000000)
GUISetState(@SW_SHOW)
$PointColor = "0x000000"
For $Y = 0 To 16
For $X = 0 To 16
ToolTip($X & " - " & $Y & @CRLF & $PointColor & " @ " & Hex(_WinAPI_SwitchColor(PixelGetColor($X, $Y, $Form1))))
Sleep(10)
Next
Next
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
PixelGetColor 获取的是绝对坐标,并非窗口的相对坐标 啊!是这样?那函数第三个参数的作用是什么? 回复 3# penguinl
那个参数似乎没用,以前测试过 好吧,测试了下,确实是绝对坐标,谢谢afan了! afan正解
页:
[1]