Silverlight设备独立坐标 [英] Silverlight device independent coordinates

查看:106
本文介绍了Silverlight设备独立坐标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写了一个Silverlight应用程序,该应用程序在从96 dpi更改为120 dpi时不会缩放.文本和图形不会改变标尺在屏幕上的物理尺寸.我读过很多地方,Silverlight应该针对DPI配置的更改进行调整.网页的非Silverlight部分会按预期缩放.似乎Silverlight插件使用像素作为度量单位,而不是1/96英寸.有什么解释?

I've written a Silverlight application that does not scale when I change from 96 dpi to 120 dpi The text and graphics does not change physical size on the screen as measured by a ruler. I've read in various places that Silverlight should adjust to changes in DPI configuration. The non-Silverlight portion of the web page scales as expected. It seems as if the Silverlight plugin is using Pixels as the unit of measure rather than 1/96 inch. What's the explanation?

我正在运行Windows XP,并在Wndows XPdesktop属性/设置/常规/DPI设置中设置DPI.

I'm running Windows XP and setting the DPI in Wndows XPdesktop properties / settings / general / DPI Setting.

推荐答案

如果您要使用可测量的坐标(即在应用中显示准确的标尺),这将无济于事,但是如果您希望自己的UI与分辨率无关,您可以将其包装为ViewBox,该ViewBox是 Silverlight工具包

This wont help if you're after measurable coordinates (ie: displaying an accurate ruler in your app), but if you want your UI to be resolution independent, you can wrap it with a ViewBox, which is part of the Silverlight Toolkit

这篇关于Silverlight设备独立坐标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆