Share via


InkCollector.DefaultDrawingAttributes Property

InkCollector.DefaultDrawingAttributes Property

Gets or sets the default DrawingAttributes object, which specifies the drawing attributes that are used when drawing and displaying ink.

Definition

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

Property Value

Microsoft.Ink.DrawingAttributes. The default DrawingAttributes object, which specifies the drawing attributes that are used when drawing and displaying ink.

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

Exceptions

ArgumentNullException Leave Site:
COMException Leave Site:
ObjectDisposedException Leave Site:

Remarks

The drawing attributes specified with this property are the attributes that are assigned to a new cursor.

The default drawing attributes are as follows:

DrawingAttributes Property Description
AntiAliased true
Color Black Leave Site
FitToCurve false
Height 1 (in ink space units)
IgnorePressure false
PenTip Ball
RasterOperation CopyPen
Transparency 0 (totally opaque)
Width 53 (in ink space units)

To set different attributes on a new cursor, use the DrawingAttributes property of the Cursor object.

To change the drawing attributes of a single stroke, use the DrawingAttributes property of the Stroke object. To change the drawing attributes of a collection of strokes, call the ModifyDrawingAttributes method of the Strokes collection.

Note: The DefaultDrawingAttributes property contains the drawing attributes that all cursors use unless they set their own DrawingAttributes property. For example, a new Cursor object uses DefaultDrawingAttributes, and an old Cursor object on which the DefaultDrawingAttributes is set to null also uses DefaultDrawingAttributes.

Examples

[C#]

This C# example sets some of the default drawing attributes of an InkCollector.

using Microsoft.Ink;
//. . .
InkCollector theInkCollector = new InkCollector();

// Set the initial Width attribute to thin
theInkCollector.DefaultDrawingAttributes.Width = 30;

// Set the initial Color attribute to Black
theInkCollector.DefaultDrawingAttributes.Color = Color.Black;

// Set the initial RasterOperation attribute to CopyPen
theInkCollector.DefaultDrawingAttributes.RasterOperation = RasterOperation.CopyPen;

// Set the initial Transparency attribute to opaque (0)
theInkCollector.DefaultDrawingAttributes.Transparency = 0;

// Set the initial AntiAliased attribute to true
theInkCollector.DefaultDrawingAttributes.AntiAliased = true;
            

[VB.NET]

This Microsoft® Visual Basic® .NET example sets some of the default drawing attributes of an InkCollector.

Imports Microsoft.Ink
'. . .
Dim theInkCollector As New InkCollector()

'Set the initial Width attribute to thin
theInkCollector.DefaultDrawingAttributes.Width = 30

'Set the initial Color attribute to Black
theInkCollector.DefaultDrawingAttributes.Color = Color.Black

'Set the initial RasterOperation attribute to CopyPen
theInkCollector.DefaultDrawingAttributes.RasterOperation = RasterOperation.CopyPen

'Set the initial Transparency attribute to opaque (0)
theInkCollector.DefaultDrawingAttributes.Transparency = 0

'Set the initial AntiAliased attribute to true
theInkCollector.DefaultDrawingAttributes.AntiAliased = True
            

See Also