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

前端 未结 5 1419
南笙
南笙 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条回答
  •  猫巷女王i
    2020-12-08 03:00

    How about this?

    var bounds = Window.Current.Bounds;
    
    double height = bounds.Height;
    
    double width = bounds.Width;
    

提交回复
热议问题