Screen Resolution Problem In WPF?

后端 未结 8 1225
孤城傲影
孤城傲影 2020-11-30 00:13

I\'m gonna detect the resolution with the following code in WPF :

double height = System.Windows.SystemParameters.PrimaryScreenHeight;
double width = S         


        
8条回答
  •  醉梦人生
    2020-11-30 00:42

    If you check "Use Windows XP style DPI scaling", then the returned value of "Screen.PrimaryScreen.Bounds" is correct. If not, the returned value is proportionally shrunk by the DPI value (which is the default).

    To find the "Use Windows XP style DPI scaling" checkbox, expand the "To make text and on-screen items clearer in programs that aren't designed for high DPI" link in the following link: http://windows.microsoft.com/en-us/windows-vista/Make-the-text-on-your-screen-larger-or-smaller

提交回复
热议问题