如何获取 wp7 ppi 或物理屏幕尺寸?
我正在为 wp7 创建(又一个)标尺应用程序。
我知道资源。始终为 480x800,但设备具有不同的屏幕尺寸。
我尝试四处搜索,但找不到如何获取 ppi,因此我可以将像素映射到物理尺寸。
那么如何获取当前设备的 ppi 或物理屏幕尺寸?
I'm creating (yet another) ruler app for wp7.
I know the res. is always 480x800, but devices have different screen sizes.
I tried searching around, but i couldn't find out how to get the ppi, so i can map the pixels to the physical dimension.
so how do i get the ppi of the current device, or the physical screen size ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
无法检索设备上的 PPI,最好的办法是维护设备及其各自的 PPI 列表。您可以使用此辅助方法来访问设备属性:
现在相关属性为:
希望这会有所帮助!有关 DeviceExtendedProperties 的详细信息,请访问 MSDN
There is no way to retrieve the PPI on the device, you best shot would be to maintain a list of devices and their respective PPI. You can use this helper method to access device properties:
Now the relevant properties would be:
Hope this helps! More information about DeviceExtendedProperties can be found on MSDN