共用方式為


DrawingAttributes Property

DrawingAttributes Property

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

Declaration

[C++]

[propputref] HRESULT putref_DrawingAttributes (
    [in] InkDrawingAttributes *DrawingAttributes);
[propget] HRESULT get_DrawingAttributes (
    [out, retval] InkDrawingAttributes** DrawingAttributes);

[Microsoft® Visual Basic® 6.0]

Public Property Get DrawingAttributes() As InkDrawingAttributes
Public Property Let DrawingAttributes( _
    ByVal theAttributes As InkDrawingAttributes)

Property Value

InkDrawingAttributes Returns or sets the InkDrawingAttributes object that determines the attributes to apply to ink as it is drawn. If this object is NULL, the cursor uses the default drawing attributes of the InkCollector object.

This property is read/write.

Return Value

HRESULT value Description
S_OK Success. The parameter contains the attributes that you set for the known cursor.
E_OUTOFMEMORY Cannot allocate memory to store the drawing attributes.
E_INK_EXCEPTION An exception occurred while processing.
E_POINTER A parameter contains an invalid pointer.
E_FAIL An unspecified error occurred.
E_UNEXPECTED Unexpected parameter or property type.
REGDB_CLASSNOTREG The InkDrawingAttributes object was not registered.

Remarks

The drawing attributes specify the appearance of the stroke. For example, you can specify the style and color of a pen.

A cursor can have different drawing attributes for each InkCollector with which it comes in contact. If you do not specify drawing attributes for a cursor, it uses the default drawing attributes of the InkCollector object. These default attributes are set with the DefaultDrawingAttributes property of the InkCollector object.

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: This property behaves differently than the DefaultDrawingAttributes property. Although the DefaultDrawingAttributes property specifies the drawing attributes that are applied to a new cursor, the DrawingAttributes property specifies the drawing attributes for ink that is yet to be collected.

Example

[Visual Basic 6.0]

This Visual Basic 6.0 example sets the drawing attributes of the first cursor in the IInkCursors collection of an InkCollector object.

Dim theDrawingAttributes As New InkDrawingAttributes
theDrawingAttributes.Width = 300
theDrawingAttributes.Color = vbMagenta
theInkCollector.Cursors(0).DrawingAttributes = theDrawingAttributes

Applies To