Skip to main content

Screen resolution or pixel units.

1 reply [Last post]
Joined: 2006-02-14

I work whit a geographic map. I have to compute the scale... I know the number of the pixel (but I think that is no needed) and the meters that a pixel rappresents in the real world. Now... how can I know the meters that this pixel misure in the screen?
Thanks for the help!!

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2003-06-10

Try GraphicsConfiguration.getNormalizingTransform.
Note however that the declared resolution of screens is usually not the real physical resolution, but a value that gives the user a comfortable display. A 10 pt font is then larger on the screen than it would be on paper to allow for the fact that the screen is usually further away from the user than normal reading distance.

You can also use Toolkit.getScreenResolution, but this doesn't provide for multiple displays.