Font.Height 属性

获取此字体的行距。

**命名空间:**System.Drawing
**程序集:**System.Drawing(在 system.drawing.dll 中)

语法

声明
Public ReadOnly Property Height As Integer
用法
Dim instance As Font
Dim value As Integer

value = instance.Height
public int Height { get; }
public:
property int Height {
    int get ();
}
/** @property */
public int get_Height ()
public function get Height () : int

属性值

此字体的行距(以像素为单位)。

备注

行距是两个连续文本行的基线之间的垂直距离。因此,行距包括行间的空白空间及字符本身的高度。

如果将字体的 Unit 属性设置为 GraphicsUnit.Pixel 以外的任何值,则使用屏幕显示的垂直分辨率来计算高度(以像素为单位)。例如,假定字体单位为英寸,字体大小为 0.3。并假定对于相应的字体系列,全身高度为 2048,行距为 2355。对于垂直分辨率为 96 点/英寸的屏幕显示,可以按如下所示计算高度:

2355*(0.3/2048)*96 = 33.11719

GetHeight 方法将返回值 33.11719,而 Height 属性将返回值 34,这是因为 Height 属性是由 GetHeight 返回的舍入到最接近的整数的值。

平台

Windows 98、Windows 2000 SP4、Windows CE、Windows Millennium Edition、Windows Mobile for Pocket PC、Windows Mobile for Smartphone、Windows Server 2003、Windows XP Media Center Edition、Windows XP Professional x64 Edition、Windows XP SP2、Windows XP Starter Edition

.NET Framework 并不是对每个平台的所有版本都提供支持。有关受支持版本的列表,请参见系统要求

版本信息

.NET Framework

受以下版本支持:2.0、1.1、1.0

请参见

参考

Font 类
Font 成员
System.Drawing 命名空间

其他资源

如何:获取字体规格