Поделиться через


DrawingAttributes.Height Property

DrawingAttributes.Height Property

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

Definition

Visual Basic .NET Public Property Height As Single
C# public float Height { get; set; }
Managed C++ public: __property float* get_Height();
public: __property void set_Height(float*);

Property Value

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

This property is read/write.

1 Default. 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. The value represents the height of the side of the rectangle. If using the Ball pen tip 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.

Examples

[C#]

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

[VB.NET]

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
                

See Also