How to get the resolution of screen? For a WinRT app?

前端 未结 5 1414
南笙
南笙 2020-12-08 02:47

I want to know the screen resolution so that I can set the height of an element according to the resolution in a Windows 8 app.

5条回答
  •  春和景丽
    2020-12-08 03:14

    Probably the best option for DirectX-enabled apps, however, applicable to all other kinds of metro apps is:

    http://blogs.microsoft.co.il/blogs/tomershamam/archive/2012/07/24/get-screen-resolution-in-windows-8-metro-style-application.aspx

    P.S. C'mon, getting window size to determine screen resolution? What about snapped/filled modes? This world is so much broken :-/

提交回复
热议问题