DrawingAttributes.Height 属性
获取或设置绘制墨迹 时笔尖的 y 轴尺寸或高度。
命名空间: Microsoft.Ink
程序集: Microsoft.Ink(在 Microsoft.Ink.dll 中)
语法
声明
Public Property Height As Single
用法
Dim instance As DrawingAttributes
Dim value As Single
value = instance.Height
instance.Height = value
public float Height { get; set; }
public:
property float Height {
float get ();
void set (float value);
}
/** @property */
public float get_Height()
/** @property */
public void set_Height(float value)
public function get Height () : float
public function set Height (value : float)
属性值
类型:System.Single
绘制墨迹时笔尖的 y 轴尺寸或高度。
值 |
含义 |
---|---|
1 |
笔尖的高度为一 (1) 个 HIMETRIC 单位。 |
Single |
表示笔尖高度的值,采用 HIMETRIC 单位。 |
备注
Height 属性采用 HIMETRIC 单位。
此属性仅适用于 Rectangle 笔尖,即 PenTip 枚举值。此值表示矩形侧边的高度。如果采用 Ball 笔尖值,则笔尖的高度等于 Width 属性,而忽略 Height 属性。
精度限制为 HIMETRIC 单位的千分之一(小数点之后三位)。例如,如果指定一个值 2.0006,则最精确的测量结果为 2.001。
示例
此 C# 示例创建用于更改 DrawingAttributes 对象的 Height 属性的菜单项的事件处理程序。
using Microsoft.Ink;
//...
private System.Windows.Forms.MenuItem menuInkHeightShort;
private System.Windows.Forms.MenuItem menuInkHeightTall;
private InkCollector theInkCollector;
private System.Windows.Forms.MenuItem checkedHeight;
//...
private void menuInkHeightShort_Click(
object sender, System.EventArgs e)
{
checkedHeight.Checked = false;
// Set the height to about one pixel in HIMETRIC
theInkCollector.DefaultDrawingAttributes.Height = 30;
checkedHeight = menuInkHeightShort;
checkedHeight.Checked = true;
Refresh();
}
private void menuInkHeightTall_Click(
object sender, System.EventArgs e)
{
checkedHeight.Checked = false;
// Set the height about ten pixels tall in HIMETRIC
theInkCollector.DefaultDrawingAttributes.Height = 300;
checkedHeight = menuInkHeightTall;
checkedHeight.Checked = true;
Refresh();
}
此 Microsoft(R) Visual Basic(R) .NET 示例创建用于更改 DrawingAttributes 对象的 Height 属性的菜单项的事件处理程序。
Imports Microsoft.Ink
'...
Dim MenuInkHeightShort As System.Windows.Forms.MenuItem
Dim MenuInkHeightTall As System.Windows.Forms.MenuItem
Dim CheckedHeight As System.Windows.Forms.MenuItem
Dim theInkCollector As InkCollector
'...
Private Sub MenuInkHeightShort_Click( _
ByVal sender As Object, ByVal e As System.EventArgs)
CheckedHeight.Checked = False
'Set the pen about one pixel tall in HIMETRIC
theInkCollector.DefaultDrawingAttributes.Height = 30
CheckedHeight = MenuInkHeightShort
CheckedHeight.Checked = True
Refresh()
End Sub
Private Sub MenuInkHeightTall_Click( _
ByVal sender As Object, ByVal e As System.EventArgs)
CheckedHeight.Checked = False
'Set the pen about ten pixels tall in HIMETRIC
theInkCollector.DefaultDrawingAttributes.Height = 300
CheckedHeight = MenuInkHeightTall
CheckedHeight.Checked = True
Refresh()
End Sub
平台
Windows Vista
.NET Framework 和 .NET Compact Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求。
版本信息
.NET Framework
受以下版本支持:3.0