Dela via


InkStroke.DrawingAttributes Property

Definition

Gets or sets the properties associated with an InkStroke.

public:
 property InkDrawingAttributes ^ DrawingAttributes { InkDrawingAttributes ^ get(); void set(InkDrawingAttributes ^ value); };
InkDrawingAttributes DrawingAttributes();

void DrawingAttributes(InkDrawingAttributes value);
public InkDrawingAttributes DrawingAttributes { get; set; }
var inkDrawingAttributes = inkStroke.drawingAttributes;
inkStroke.drawingAttributes = inkDrawingAttributes;
Public Property DrawingAttributes As InkDrawingAttributes

Property Value

The drawing attributes.

Examples

The following example demonstrates how to set a drawing attribute for a specific stroke.

Note

You cannot set the DrawingAttributes property of the stroke directly. You must create a copy of the InkDrawingAttributes of the stroke, set the desired values for that InkDrawingAttributes object, and then assign the new InkDrawingAttributes to the DrawingAttributes of the stroke, as shown here.

// Get the InkStroke objects.
IReadOnlyList<InkStroke> inkStrokes = inkManager.GetStrokes();
Windows.UI.Input.Inking.InkStroke cloneStroke = 
  inkStrokes.GetAt(index).Clone();
Windows.UI.Input.Inking.InkDrawingAttributes drawingAttributes = 
  cloneStroke.DrawingAttributes;
drawingAttributes.PenTip = Windows.UI.Input.Inking.PenTipShape.Rectangle;
cloneStroke.DrawingAttributes = drawingAttributes;

Applies to

See also