1

When using int resolution = Toolkit.getDefaultToolkit().getScreenResolution(); to get my monitor's resolution, the integer resolution returns 96. What does this mean, how could it be used, and, if possible, could I get the resolution in a 4:3, 16:9, etc. format?

8bitslime
  • 164
  • 1
  • 13
  • 1
    If I'm not mistaken that's the dpi (dots per inch). All this `4:3` is, is the screen width/height ratio, has nothing to do with resolution. How many dots per inch, the resolution. The higher the dpi, the higher (or more detailed) the resolution. – Paul Samsotha Jan 01 '14 at 12:21

1 Answers1

1

getScreenResolution() return dots-per-inch (DPI). If you want the size of the screen, just use getScreenSize().

Here's a quote that gets you the basic idea of DPI vs. pixels:

So, if you have a 600 pixel x 600 pixel image at 300DPI, it will output at 2 inches square. If you change this images DPI to 150, this will mean it will output at 4 inches square. So, as you can see, changing the DPI of an image changes it output size.

You can find rest of the explanation here.

t0mppa
  • 3,983
  • 5
  • 37
  • 48
  • I feel stupid for not thinking of that. I understand DPI and resolution, it just had to leave my head at the time. Thanks. – 8bitslime Jan 01 '14 at 12:33