Search code examples
c#windows-8.1windows-10win-universal-appuwp

Retrieving Windows device's DPI


Is there an API in the UWP to retrieve the device dpi? In Android there is the getDisplayMetrics().density; method. Is there an equivalent in UWP?

It looks like I'm looking for RawDPI or perhaps ScaleFactor that used to be available on the phone.


Solution

  • Found it here after a bit of digging:

    Windows.Graphics.Display.DisplayInformation

    Lots of good stuff available include raw dpi and scale factor.