#Difference between java.awt.Robot Screenshot Pixel Coordinates and Intercepted Mouse Coordinates

1 messages · Page 1 of 1 (latest)

hollow hinge
#

As seen in the first screenshot, the found pixel coordinate according to java.awt.Robot is the one in the array. However, when I try to intercept the mouse event, the same mouse event has the coordinates provided in CURR.

The way I obtain the image in which I find the pixel is:

        BufferedImage screenImage = robot.createScreenCapture(screenRect);```

Afterward, I check the dimensions of the screenImage using this code.

        ```int width = screenImage.getWidth();
        int height = screenImage.getHeight();```


I noticed though that the width and height of the image are 0.8 * the corresponding measurements of my screen. What I think is happening is that the Robot coordinates are 0.8 of the screen size and then the actual mouse event dispatched has that scaled to the actual screen. Can anyone give me an explanation of why this discrepancy arises?
finite cradleBOT
#

This post has been reserved for your question.

Hey @hollow hinge! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

strange vine
#

Dude, organize your thoughts. If you have a problem with how java.awt.Robot measures your screen, don't come and talk about JNativeHook. That should come without saying.

hollow hinge
#

Is that better?