Is there a way to get the screen resolution in WinRt app? I know in windows phone it's possible:
var scaleFactor = DisplayInformation.GetForCurrentView().RawPixelsPerViewPixel;
var bounds = Window.Current.Bounds;
var x = (int) (bounds.Width*scaleFactor);
var y = (int) (bounds.Height*scaleFactor);
var resolution = String.Format("{0}x{1}", Math.Max(x, y),Math.Min(x,y));
But in winrt I don't have the RawPixelsPerViewPixel method...
Any ideas?
I've tried to follow the Detect screen scaling factor in Windows 8.1 store apps post :
ResolutionScale resolutionScale = DisplayInformation.GetForCurrentView().ResolutionScale;
double scale = (double)resolutionScale / 100.0;
var bounds = Window.Current.Bounds;
var x = (int)(bounds.Width * scale ) ;
var y = (int)(bounds.Height * scale );
var resolution = String.Format("{0}x{1}", Math.Max(x, y), Math.Min(x,y) );
But I am getting wrong numbers, for resolution 1920 x 1080 I get "1920x1008" and for resolution 800 x 600 I get "1126x743"