Silverlight 和 WPF 使用哪些度量单位? [英] What measurement units does Silverlight and WPF use?
问题描述
有谁知道 Silverlight/WFP 使用什么度量单位?例如,如果我创建一个新按钮并将其高度设置为 150,那是 150 像素吗?点?毫米?
Does anyone know what measurement units are used by Silverlight/WFP? For example, if I create a new button and set its height to 150, is that 150 pixels? points? millimeters?
在继续编码之前,我在 Adobe Illustrator 中设计了我的所有应用程序,尽管我尝试将所有内容设置为 Illustrator 文件中的尺寸,但 Silverlight 应用程序通常更大.
I design all of my applications in Adobe Illustrator before proceeding to code, and although I try and set everything to the dimensions in my Illustrator file, the Silverlight application is usually larger.
推荐答案
MSDN 的文档指出 FrameworkElement.Height
属性(对于 Silverlight)指的是:
MSDN's documentation states that the FrameworkElement.Height
property (for Silverlight) refers to:
物体的高度,以像素为单位
The height, in pixels, of the object
但是,对于WPF,它指的是:
独立于设备的单位(1/96 英寸)测量
a device-independent unit (1/96th inch) measurement
所以,要回答您的问题...像素适用于 Silverlight,设备独立单位适用于 WPF.
So, to answer your question... pixels for Silverlight, device-independent units for WPF.
这篇关于Silverlight 和 WPF 使用哪些度量单位?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!