New GetPixel function's don't seem to work
Posted: December 16th, 2004, 6:27 am
I tried to test the new GetPixel with window handle functions and it bombs out.
Here is a modified version of the GetPixelColorDemo.vbs file.
The fgwin seems to to work fine, returns a 6 digit number.
But when I go to pass it to the GetPixelColor() function as the 3rd param, it bombs. I have tried just a 0, since that would be default. Have also tried CLng(0) to see if it forces it to Long, no luck.
Any help Admin/Wyv?
Dim x,y,color,r,g,b,fgwin
fgwin=Win32API.XUGetForegroundWindow()
staMouse.Text = fgwin
XUScriptHost.Sleep 3000
do while bRunning
XUScriptHost.GetCursorPos x,y
color = XUScriptHost.GetPixelColor(x,y,fgwin)
r = XUScriptHost.ExtractRGB_Red(color)
g = XUScriptHost.ExtractRGB_Green(color)
b = XUScriptHost.ExtractRGB_Blue(color)
staMouse.Text = "X:" & x & " Y:" & y
staColor.Text = "R:" & r & " G:" & g & " B:" & b & " =>" & color
XUScriptHost.Sleep 100
loop
Here is a modified version of the GetPixelColorDemo.vbs file.
The fgwin seems to to work fine, returns a 6 digit number.
But when I go to pass it to the GetPixelColor() function as the 3rd param, it bombs. I have tried just a 0, since that would be default. Have also tried CLng(0) to see if it forces it to Long, no luck.
Any help Admin/Wyv?
Dim x,y,color,r,g,b,fgwin
fgwin=Win32API.XUGetForegroundWindow()
staMouse.Text = fgwin
XUScriptHost.Sleep 3000
do while bRunning
XUScriptHost.GetCursorPos x,y
color = XUScriptHost.GetPixelColor(x,y,fgwin)
r = XUScriptHost.ExtractRGB_Red(color)
g = XUScriptHost.ExtractRGB_Green(color)
b = XUScriptHost.ExtractRGB_Blue(color)
staMouse.Text = "X:" & x & " Y:" & y
staColor.Text = "R:" & r & " G:" & g & " B:" & b & " =>" & color
XUScriptHost.Sleep 100
loop