Screen Resolution on Windows 10 java

Hi,

I was trying to do screenshots with Java in order to display my ROIs in a montage made of these screenshots but I encountered a problem with the location of the window because of (I believe) the wrong result returned by methods to give screen resolution.

It returns (1536x864) but my screen resolution is (1920x1080).

I used the following methods :
IJ.getScreenSize()
Toolkit.getDefaultToolkit().getScreenSize()

I tried both methods on a Windows 7 computer and it worked properly, so I’m wondering whether it is a Windows 10 issue or my computer’s problem. (I don’t have other Windows 10 devices to try on).

Thanks for your time.

Sorry for the delay in reply, @AdaTextIO!

Do you have multiple monitors plugged in? Might it be giving the resolution for the wrong monitor? Or is your 1080p screen perhaps not actually set to full 1080p resolution?

Have a look at this SO answer for some further discussion and suggestions. It could also conceivably be related to the HiDPI feature of Windows 10, although some web searches just now did not turn up any bug reports along these lines for me.

1 Like

Hi @ctrueden,

First, I don’t use multiple monitors and the problem doesn’t seem to come from the HiDPI feature or the 1080p resolution.

Moreover, I recently discovered that this bug only occured with Fiji, I tried it with ImageJ and it returned the correct resolution.

Thanks for your answer.

Writing again because I finally found a way,

The problem actually comes from here, but what is told on your link says that :

In ImageJ.exe :arrow_forward: Properties :arrow_forward: Compatibility, ensure that the “Disable display scaling on high DPI settings” option is not enabled.

I actually had to enable it in order to fix my problem, so I don’t know if it’s just a typo or that I just got lucky, but anyways I fixed it so thank you for helping me.

1 Like

Thanks for following up. I have now changed that section of the wiki page to read:

In ImageJ.exe :arrow_forward: Properties :arrow_forward: Compatibility, check the “Disable display scaling on high DPI settings” option. Try with it enabled, as well as disabled—some users have reported success only with this option off, and others only with it on.

Hopefully this now gives a hint that either mode might the right solution for a particular system.