Detect Dots Per Inch (DPI)

Hi,

currently i’m porting one of our games to WP8 - basically this works very well.

BUT currently i’m facing a problem: Screen.dpi returns 0 on my Windows Phone 8 device and I need this value to scale my GUI appropriately.

What I tried then was to write a WP8 plugin, which provides access to Windows.Graphics.Display.DisplayProperties.LogicalDpi.
Works, it returns 144, BUT the device (Samsung Ativ S) has a DPI of 306. Thereby the GUI scaling gets corrupted…

Anyone uses DPI in WP8 and can tell how to use it? Is there alternative native method, that I can invoke to get the correct DPI?

Best regards!

Hey did you ever get this working?
It has also broken my GUI since Screen.dpi only returns 0 in unity WP8…

Problem is, we cannot guarantee that the DPI from all phones we get is accurate.

Windows.Graphics.Display.DisplayProperties.LogicalDpi returns LogicalDpi as it says, which is unrelated to physical one.

For physical DPI, you can use this API:

However, it is only available on devices that run Windows Phone 8 Update 3 or higher, else it returns 0.

Thanks mate!