I am developing a UWP application and I have to get the actual screen resolution that user has set(e.g. 1600 x 900). I went through many similar questions on stackoverflow, tried them in my code but none could help.
To get the current screen resolution, I have the following code:
var bounds = ApplicationView.GetForCurrentView().VisibleBounds;
var scaleFactor = DisplayInformation.GetForCurrentView().RawPixelsPerViewPixel;
var size = new Size(bounds.Width * scaleFactor, bounds.Height * scaleFactor);
Height = size.Height;
Width = size.Width;
My Desktop Resolution is set to 1600 x 900. Using this code I get the Height as 828 and width as 1600 (i.e. 1600 x 828). But my requirement is to get actual resolution i.e. 1600 x 900 that is set by the user.Please guide me how can I achieve that.
Thanks