08-17-2010, 03:31 AM
I'm dabbling in pixel recognition and what I want to do is check 3 pixels on my screen and if any one of them is of 3 preset values perform a function.
what I have is along these lines:
if ((pixel(100 150)=0xFFAAFF)||(pixel(100 150)=0x1A6786)||(pixel(100 150)=0x0102FF)||(pixel(110 150)=0xFFAAFF)||(pixel(110 150)=0x1A6786)||(pixel(110 150)=0x0102FF)||(pixel(120 140)=0xFFAAFF)||(pixel(120 140)=0x1A6786)||(pixel(120 140)=0x0102FF))
The problem I have with this is that i'm pretty sure there must be a more efficient way of doing this check
what I have is along these lines:
if ((pixel(100 150)=0xFFAAFF)||(pixel(100 150)=0x1A6786)||(pixel(100 150)=0x0102FF)||(pixel(110 150)=0xFFAAFF)||(pixel(110 150)=0x1A6786)||(pixel(110 150)=0x0102FF)||(pixel(120 140)=0xFFAAFF)||(pixel(120 140)=0x1A6786)||(pixel(120 140)=0x0102FF))
The problem I have with this is that i'm pretty sure there must be a more efficient way of doing this check