DrawingAttributes.Width Property

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Gets or sets the width of the stylus that is used to draw a Stroke.

Namespace:  System.Windows.Ink
Assembly:  System.Windows (in System.Windows.dll)
XMLNS for XAML: Not mapped to an xmlns.

Syntax

Public Property Width As Double
public double Width { get; set; }
<DrawingAttributes Width="double"/>

Property Value

Type: System..::.Double
The width of the stylus that is used to draw a Stroke. The default is 2 logical pixels.

Remarks

If you try to set the Width property to 0 logical pixels, it is changed to 2 logical pixels.

Examples

The following code example demonstrates how to set the Width property. This is part of a larger example available in DrawingAttributes class overview.

    'Set drawing attributes to simulate a highlighter
    Private Sub BtHighlighter_Click(ByVal sender As Object, ByVal e As EventArgs)
        MyDA.Width = 25
        MyDA.Height = 5
        MyDA.Color = Colors.Yellow
        MyDA.OutlineColor = Colors.Yellow
    End Sub

//Set drawing attributes to simulate a highlighter
private void BtHighlighter_Click(object sender, EventArgs e)
{
    MyDA.Width = 25;
    MyDA.Height = 5;
    MyDA.Color = Colors.Yellow;
    MyDA.OutlineColor = Colors.Yellow;
}

Version Information

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Platforms

Windows Phone

See Also

Reference

DrawingAttributes Class

System.Windows.Ink Namespace

InkPresenter

Stroke

DrawingAttributes