In Crysis 3 (and in almost all full-screen games) I try to get the color of the pixel, in the coordinate, next to the cursor:

robot = new Robot(GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice()); System.out.println(robot.getPixelColor( (int) MouseInfo.getPointerInfo().getLocation().getX() + 10, (int) MouseInfo.getPointerInfo().getLocation().getY() + 10 )); 

On what I receive the message:

 java.awt.Color[r=0,g=0,b=0] 

Although in other games / windows the correct color is displayed. What could be the problem and how to fix it?

  • one
    And you try to make a screen screen, it will be black. It seems that all this does not work if the application is running via DirectX or another engine that overrides frame rendering. There need to do more difficult. - pavel
  • @pavel, maybe .. And why does everything work in window mode? - user189127

0