In der Robot Klasse gibt es ein getPixelColor():
getPixelColor(int x, int y)
Code:
import java.awt.*;
private Color getPixColor(int x, int y){
Color col;
GraphicsDevice screen;
try{screen=getDefaultScreenDevice();}
catch (HeadlessException e){throw new IllegalArgumentException("No defaultScreenDevice");}
try{
Robot myRobbie=new Robot(screen);
col=myRobbie.getPixelColor(x,y)
}
catch(RuntimeException e){throw new IllegalArgumentException(e.getMessage());}
return col;
}
____________________________________
Join the DNRC |
Godwin\'s Law (thx@stona)
Documentation is like sex: If it\'s good, it\'s very, very good. If it\'s bad, it\'s better than nothing.
\"In theory, theory and practice are the same. In practice, they are not\" (Lawrence Berra)