How to get the screen DPI in java?

前端 未结 2 2083
离开以前
离开以前 2020-12-03 23:06

I am developing an app for which I need the screen DPI.. I checked a few forums and got a code snippet which goes as follows:

Dimension screen = java.awt.Too         


        
2条回答
  •  暖寄归人
    2020-12-03 23:18

    The problem is no one, not even the OS, knows the exact physical dimensions of the screen. You'd need to know that in order to calculate the PPI.

    There's a display setting in the control panel where the user can manually specify the PPI and by default it's set to 96.

提交回复
热议问题