Compartir a través de


InkCollector.DefaultDrawingAttributes Property

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

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

Syntax

'Declaration
Public Property DefaultDrawingAttributes As DrawingAttributes
'Usage
Dim instance As InkCollector
Dim value As DrawingAttributes

value = instance.DefaultDrawingAttributes

instance.DefaultDrawingAttributes = value
public DrawingAttributes DefaultDrawingAttributes { get; set; }
public:
property DrawingAttributes^ DefaultDrawingAttributes {
    DrawingAttributes^ get ();
    void set (DrawingAttributes^ value);
}
/** @property */
public DrawingAttributes get_DefaultDrawingAttributes ()

/** @property */
public void set_DefaultDrawingAttributes (DrawingAttributes value)
public function get DefaultDrawingAttributes () : DrawingAttributes

public function set DefaultDrawingAttributes (value : DrawingAttributes)
Not applicable.

Property Value

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

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

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 a null reference (Nothing in Visual Basic) also uses DefaultDrawingAttributes.

Example

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;

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

Platforms

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

InkCollector Class
InkCollector Members
Microsoft.Ink Namespace
DrawingAttributes
Cursor.DrawingAttributes
Stroke.DrawingAttributes
Strokes.ModifyDrawingAttributes