Hi,
I'm still pretty new at AutoHotkey.
I would like to check if a region on (specified by 4 coordinates) has specific solid pixel color (white in this case).
I know how to check on a color of a specific pixel, but not on a region.
Is anybody able who can help me?
Example what I want to do:
if (region = white) then
press space bar
else
press enter key
check for pixel color on a region
Re: check for pixel color on a region
if u wanna check if a region contains a pixel of a specified color use PixelSearch
if u wanna check if the entirety of a region is of a specified color u figure out its width and height, set up 2 nested loops and check each pixel within, individually, using PixelGetColor or other means(gdip_getlockbitpixel)
if u wanna check if the entirety of a region is of a specified color u figure out its width and height, set up 2 nested loops and check each pixel within, individually, using PixelGetColor or other means(gdip_getlockbitpixel)
Re: check for pixel color on a region
Hi,
I have updated the code a little, so that I only check on a horizontal line of pixels;
I have created this code, for testing purposes:
however, I can't get the messagebox popup "white space detected", which I would expect on a completely white screen,
although I am sure the screen is white.
Anyone can help me?
I have updated the code a little, so that I only check on a horizontal line of pixels;
I have created this code, for testing purposes:
Code: Select all
^j::
x:= 800
while (x <= 810)
{
pixelGetColor, pColor, x, 500
if (pColor == FFFFFF)
{
Msgbox, white text detected!
break
}
x:= x +1
}
Msgbox, Done!
although I am sure the screen is white.
Anyone can help me?
Re: check for pixel color on a region
FFFFFF in the context of your if-statement is an unitialized variable, and not a hexadecimal number. u need:
Code: Select all
if (color = 0xFFFFFF)
Re: check for pixel color on a region
that worked. Thanks!swagfag wrote:FFFFFF in the context of your if-statement is an unitialized variable, and not a hexadecimal number. u need:Code: Select all
if (color = 0xFFFFFF)
Who is online
Users browsing this forum: aitaixy, Anput, dangoscrub, Google [Bot], joedf, Nerafius and 148 guests