|
hWnd = cLng(0)
hDC = Extern.GetDC(hWnd)
这两行是获取屏幕设备吧。
我想要的可能会是被QTP遮盖住 ...
mgs2-007 发表于 2011-4-26 10:32
获取指定位置的颜色值
xorg = Browser("网易电子邮箱").Page("网易电子邮箱").Frame("index").Image("260x300").GetROProperty("abs_x")
yorg = Browser("网易电子邮箱").Page("网易电子邮箱").Frame("index").Image("260x300").GetROProperty("abs_y")
width = Browser("网易电子邮箱").Page("网易电子邮箱").Frame("index").Image("260x300").GetROProperty("width")
height = Browser("网易电子邮箱").Page("网易电子邮箱").Frame("index").Image("260x300").GetROProperty("height")
xnow = xorg + width/2
ynow = yorg + height/2
Extern.Declare micLong, "GetPixel","gdi32","",micLong,micLong,micLong
Extern.Declare micLong, "GetDC", "user32","",micLong
Extern.Declare micLong,"ReleaseDC","user32","",micLong, micLong
hWnd = cLng(0)
hDC = Extern.GetDC(hWnd)
Print Extern.GetPixel (hDC, xnow,ynow)
Extern.ReleaseDC hWnd, hDC |
|