Can you guys give me hints on how to find a image on screen. I mean, a simple pixel combination. For exmaple, it finds coordinates of 30x30 pixel white square.
Java robot class allows me to find color of certain pixel. But i need to opposite, I want my program to scan my screen and then tell me the coords of this little image. Well I could go through all pixels with Robot, but it should be faster than that. Much faster.
Any suggestions?
解决方案
Well I could go through all pixels with Robot, but it should be faster than that. Much faster.
I'm afraid that that's precisely what you'll have to do.
If all pixels should be white, you could first take 30 pixel wide steps and if you find a white pixel, take say, 5 pixel steps, and then if these pixels are white too, examine the remaining pixels in the square.
Something like this:
. . . . . .
. .......... . . .
......
. . . .
. . . .
. . . .......... .
..........
..........
..........
..........
. . . ..........