getPixel() and dual monitors
Posted: Fri Apr 06, 2012 4:25 pm
It doesn't appear that getPixel works correctly on the secondary monitor in dual monitor setup, it returns 255,255,255 regardless of the actual color of the pixel.
Here is the code I used to test.
Here is the code I used to test.
Code: Select all
function main()
while(1) do
hwnd = foregroundWindow();
if (hwnd ~= 0) then
hdc = openDC(hwnd);
if (hdc) then
x,y = mouseGetPos();
-- printf("mouse_x: %d, mouse_y: %d", x, y);
r,g,b = getPixel(hdc, x, y);
printf("(%d, %d) RGB: %d, %d, %d\n", x,y, r, g, b);
closeDC(hdc);
end
end
stopPE();
end
end
startMacro(main);