Get screen size and then resize image accordingly I'm a programmer working in Java and I'm not sure if this is the right place to ask this kind of question, here it goes:

In my program, I need to show an image (.jpeg .png etc.) based on the screen size, this image is used to compare to real size (physical) of an actual label which is later printed on a specific machine.

The issue is, for example on my machine I have the laptop screen and a '27 monitor they are both using the same resolution 1920x1080 but as you imagine if you resize any window/program/image it looks smaller on the laptop as the physical screen size is different although it has the same resolution (I imagine is because the physical size of the pixel is smaller than the ones on my monitor)

Now what I would need to do is somehow always show the image on it's corect physical size (as it were printed), on any type of screen.

Regarding to programming I could easily get the screens size and resize the image but, this is because the OS gives the size (it's set up size) back to the program, yet even if I have the correct size the physical screen could display the image smaller for example, as the screen's pixels are smaller.

Any ideas where to start with this?
How can I know the real physical screen size?
This seems to be more a hardware issue than graphics..
The OS does not, in many or most cases, know the physical screen size! Often the only thing you can glean is the make and model, sometimes not even that. So if you do not want to have a database then the best you can do is ask your user.

There are also some interesting corner cases. What do you do if the monitor is in fact a projector? What do you do in multi monitor setups? What if the image is halfway between 2 monitors? What do you do if the operator is using pixel zoom for accessibility reasons? What do you do if the image is shown on 2 monitors at the same time? What do you do if the monitor is huge, like one used in a conference room and your image turns out to be very small in comparison (like 4 by 4 pixels)? ...