Compartir a través de


Stroke.DrawingAttributes Property

Stroke.DrawingAttributes Property

Gets or sets the drawing attributes to apply to ink as it is drawn.

Definition

Visual Basic .NET Public Property DrawingAttributes As DrawingAttributes
C# public DrawingAttributes DrawingAttributes { get; set; }
Managed C++ public: __property DrawingAttributes* get_DrawingAttributes();
public: __property void set_DrawingAttributes(DrawingAttributes*);

Property Value

Microsoft.Ink.DrawingAttributes. The DrawingAttributes object to apply to ink as it is drawn. If this object is null (Nothing in Microsoft® Visual Basic® .NET), the Stroke uses the default drawing attributes of the ink collector object.

This property is read/write. This property has no default value.

Exceptions

ArgumentNullException Leave Site:
COMException Leave Site:

Remarks

The DrawingAttributes property specifies the appearance of ink. For example, you can specify the width or color of ink.

Successive calls to the DrawingAttributes property change only the drawing attributes of new strokes. They do not apply to strokes that are already collected or being collected.

Note: The DefaultDrawingAttributes property (InkCollector.DefaultDrawingAttributes, InkOverlay.DefaultDrawingAttributes, or InkPicture.DefaultDrawingAttributes) contains the drawing attributes that all Stroke objects use unless they set their own DrawingAttributes property. For example, a new Stroke object on which DrawingAttributes is not set and an old Stroke object on which the DrawingAttributes is set to null (Nothing in Microsoft® Visual Basic® .NET) both use DefaultDrawingAttributes property of the ink collector.

Examples

[C#]

This C# example gets the DrawingAttributes property of the first stroke of the InkCollector object, theInkCollector.

Microsoft.Ink.DrawingAttributes theDrawingAttributes
    = theInkCollector.Ink.Strokes[0].DrawingAttributes;

[Visual Basic .NET]

This Visual Basic .NET example gets the DrawingAttributes property of the first stroke of the InkCollector object, theInkCollector.

Dim theDrawingAttributes As Microsoft.Ink.DrawingAttributes _
    = theInkCollector.Ink.Strokes.Item(0).DrawingAttributes

See Also