Bagikan melalui


Stroke.DrawingAttributes Property

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

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

Syntax

'Declaration
Public Property DrawingAttributes As DrawingAttributes
'Usage
Dim instance As Stroke 
Dim value As DrawingAttributes 

value = instance.DrawingAttributes

instance.DrawingAttributes = value
public DrawingAttributes DrawingAttributes { get; set; }
public:
property DrawingAttributes^ DrawingAttributes {
    DrawingAttributes^ get ();
    void set (DrawingAttributes^ value);
}
public function get DrawingAttributes () : DrawingAttributes 
public function set DrawingAttributes (value : DrawingAttributes)

Property Value

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

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 Microsoft.Ink.InkPicture) 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 nulla null reference (Nothing in Visual Basic) (Nothing in Visual Basic .NET) both use DefaultDrawingAttributes property of the ink collector.

Examples

This example gets the DrawingAttributes property of the first selected stroke of an InkOverlay object.

If mInkOverlay.Selection.Count > 0 Then 
    Dim firstSelectedDA As DrawingAttributes = mInkOverlay.Selection(0).DrawingAttributes
End If
if (mInkOverlay.Selection.Count > 0)
{
    DrawingAttributes firstSelectedDA = mInkOverlay.Selection[0].DrawingAttributes;
}

Platforms

Windows 7, Windows Vista, Windows Server 2008 R2, Windows Server 2008

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

Stroke Class

Stroke Members

Microsoft.Ink Namespace

Stroke

DrawingAttributes

Cursor

Cursor.DrawingAttributes

InkCollector.DefaultDrawingAttributes

InkOverlay.DefaultDrawingAttributes

InkPicture.DefaultDrawingAttributes