共用方式為


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® Visual Basic® .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

請參閱

參考

DrawingAttributes 類別

DrawingAttributes 成員

Microsoft.Ink 命名空間

DrawingAttributes.PenTip

DrawingAttributes.Width