Quantcast
Channel: .NET Framework Class Libraries forum
Viewing all articles
Browse latest Browse all 8156

Surface tablet logical resolution

$
0
0

I am working on a project that requires me to get the resolution of the screen of the primary screen. I am using C# .NET 3.5 framework in Windows. For all laptops I am able to get the resolution using these two calls:

string width =Screen.PrimaryScreen.Bounds.Width.ToString();string height =Screen.PrimaryScreen.Bounds.Height.ToString();

However, this does not work for Surface tablets or high resolution laptops that do auto scaling at all as the calls return a much lower resolution than what is being displayed in the display settings of the tablets. I understand that this has to do with Windows doing special thing related to DPI and scaling the screen accordingly.

However, I am not sure how to programatically retrieve the resolution of the Surface tablets accurately (what ever the display settings are reporting those metrics).


Viewing all articles
Browse latest Browse all 8156

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>