Reputation: 5264
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.
Upvotes: 3
Views: 4589
Reputation: 10904
Adding sample how to get the DisplayInformation in C++/winrt
#include "winrt/Windows.Graphics.Display.h"
auto displayInfo = Windows::Graphics::Display::DisplayInformation::GetForCurrentView();
Upvotes: 0
Reputation: 6903
in Addition to correct answer. There is even more than that you can get actual screen size using.
DisplayInformation.GetForCurrentView().DiagonalSizeInInches;
Upvotes: 2