다음을 통해 공유


DrawingAttributes.Height Property

Gets or sets the y-axis dimension, or height, of the pen tip when drawing ink.

Namespace: Microsoft.Ink
Assembly: Microsoft.Ink (in microsoft.ink.dll)

Syntax

'Declaration
Public Property Height As Single
'Usage
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)
Not applicable.

Property Value

The y-axis dimension, or height, of the pen tip when drawing ink.

Value

Meaning

1

The height of the pen tip is one (1) HIMETRIC unit.

Single

Value representing the height of the pen tip, in HIMETRIC units.

Remarks

The Height property is in HIMETRIC units.

This property applies only to the Rectangle pen tip, which is the PenTip enumeration value. The value represents the height of the side of the rectangle. If using the Ball pen tip value, then the height of the pen tip is equal to the Width property, and the Height property is ignored.

Precision is limited to one one-thousandth of a HIMETRIC unit (three digits to the right of the decimal point). For example, if you specify a value of 2.0006, the most precise measurement is 2.001.

Example

This C# example creates event handlers for menu items that change the Height property of a DrawingAttributes object.

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();
    }

This Microsoft® Visual Basic® .NET example creates event handlers for menu items that change the Height property of a DrawingAttributes object.

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

Platforms

Windows 98, Windows Server 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

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

DrawingAttributes Class
DrawingAttributes Members
Microsoft.Ink Namespace
DrawingAttributes.PenTip
DrawingAttributes.Width