开发者

How to detect WP7 native resolution?

开发者 https://www.devze.com 2023-03-24 21:12 出处:网络
I realize there\'s only one resolution currently, but this would be nice to know. I\'d also like to know how to set th开发者_运维百科e orientation to portrait. I\'ve managed to do it by setting the ba

I realize there's only one resolution currently, but this would be nice to know. I'd also like to know how to set th开发者_运维百科e orientation to portrait. I've managed to do it by setting the backbuffer size, but this doesn't seem right.


This is the way it should be done:

ScreenWidth = System.Windows.Application.Current.Host.Content.ActualWidth;

ScreenHeight = System.Windows.Application.Current.Host.Content.ActualHeight;

You can set the default Orientation for the PhoneApplicationPage to Portrait with the Orientation property of the page, but you cannot force the Orientation change in any other way than rotating the device itself.

0

精彩评论

暂无评论...
验证码 换一张
取 消