none
Surface tablet logical resolution RRS feed

  • Question

  • 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).

    • Moved by Fred Bao Friday, January 16, 2015 7:59 AM WinForm Related
    • Moved by Youjun Tang Friday, January 16, 2015 9:04 AM more related to suggestion forum
    Thursday, January 15, 2015 10:30 PM

All replies

  • Hello,

    Since this issue is related with windows form, i move it to the windows form forum, there are windows form experts who would help you better.

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, January 16, 2015 7:57 AM
  • Hello,

    Since this issue is related with windows form, i move it to the windows form forum, there are windows form experts who would help you better.

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Why Fred, 

    There is nothing about windows forms in it, I think it is more Modern Apps.


    Success
    Cor

    Friday, January 16, 2015 8:46 AM
  • Why Fred, 

    There is nothing about windows forms in it, I think it is more Modern Apps.


    Success
    Cor

    Thanks Cor

    Hi jayboss,

    I'm moving your post to Surface Application forum for better supports. Thanks for your understanding.

    https://social.msdn.microsoft.com/Forums/en-US/home?forum=surfaceappdevelopment

    Best regards,
    Youjun Tang

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, January 16, 2015 9:06 AM