How exactly does the method getPixelColor(int x,int y)
from the Robot class work? I tried this code fragment:
try
{
Robot robos = new Robot();
}
catch (AWTException e)
{
}
for (int i = 0; i < 100; i++)
robos.getPixelColor(0, 0);
System.out.println("fsadf");
on my PC, which is a core 2 duo, and it took one second or less to execute the print statement. However, when I ran this same code on my laptop, which is a core i3, it took much more time (about 2-3 seconds).
What is the reason behind this? Does it have to do with the screen quality or something like that? How can I solve this problem?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…