Compartilhar via


DefaultDrawingAttributes Property

DefaultDrawingAttributes Property

Returns or sets the default drawing attributes to use when drawing and displaying ink.

Declaration

[C++]

[propputref] HRESULT putref_DefaultDrawingAttributes ([in]
    IInkDrawingAttributes* DefaultDrawingAttributes);
[propget] HRESULT get_DefaultDrawingAttributes ([out, retval]
    IInkDrawingAttributes** DefaultDrawingAttributes);

[Microsoft® Visual Basic® 6.0]

Public Property Get DefaultDrawingAttributes() _
    As InkDrawingAttributes
Public Property Set DefaultDrawingAttributes( _
    ByVal theAttributes As InkDrawingAttributes)

Property Value

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

This property is read/write.

Return Value

HRESULT value Description
S_OK Success.
E_POINTER The DefaultDrawingAttributes parameter must be a valid pointer to an InkDrawingAttributes pointer.
E_FAIL An unspecified error occurred.
E_INK_EXCEPTION An exception occurred inside the method.

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:

AntiAliased = TRUE

Color = Black (RGB(0,0,0)) if not in High Contrast mode; otherwise, Color=COLOR_WINDOWTEXT.

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 IInkCursor object.

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

Note: The DefaultDrawingAttributes property contains the drawing attributes that all cursors use unless they set their own DrawingAttributes property. For example, a new IInkCursor object uses DefaultDrawingAttributes, and an old IInkCursor object on which the DrawingAttributes is set to NULL (Nothing in Visual Basic 6.0) also uses DefaultDrawingAttributes.

Example

[Visual Basic 6.0]

This Visual Basic 6.0 example sets some of the default drawing attributes of an InkCollector.

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 = vbBlack

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

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

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

Applies To