注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

姑射道人的博客

博客新地址:nixuchen.com

 
 
 

日志

 
 

wp8获取屏幕分辨率  

2013-05-16 17:48:51|  分类: windows phone |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

In one of my previous blog post , I wrote about How to retrieve the Screen Resolution of Windows Phone 8
using C# ? .

In this blog post , I will be sharing information on how one can retrieve the Scaled Resolution of Windows Phone 8 using C# .

The Windows Phone 8 supports 3 different resolutions

  • 480 X 800 with aspect ratio of 15:9 and scaled resolution of 480 X 800
  • 768 X 1280 with aspect ratio of 15:9 and scaled resolution of 480 X 800
  • 720 X 1280 with aspect ratio of 16:9 and scaled resolution of 480 X 853

How to get the Scaled Resolution of Windows Phone 8 using C# ?

The Application.Current.Host.Content.ActualWidth and Application.Current.Host.Content.ActualHeight property can be used to retreive the necessary information w.r.t the height and width of the screen.

Below is a sample sourecode that demonstrates how to retrieve the Scaled Resolution of Windows Phone 8 using C# .

1string WindowsPhoneScreenResolution = Application.Current.Host.Content.ActualWidth.ToString() + " X " + Application.Current.Host.Content.ActualHeight.ToString();
2 
3txtScreenResolution.Text = WindowsPhoneScreenResolution;

When the Windows Phone 8 project is executed , you will see the data 480 X 800 and 480 X 853 depending on the screen resolution of the device.

How to get the Scaled Resolution of Windows Phone 8 using C# ?


How to get the Scaled Resolution of Windows Phone 8 using C# ?

How to get the Scaled Resolution of Windows Phone 8 using C# ?


How to get the Scaled Resolution of Windows Phone 8 using C# ?

  评论这张
 
阅读(1760)| 评论(0)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017