InkStroke.DrawingAttributes InkStroke.DrawingAttributes InkStroke.DrawingAttributes InkStroke.DrawingAttributes InkStroke.DrawingAttributes Property


Gets or sets the properties associated with an InkStroke.

public : InkDrawingAttributes DrawingAttributes { get; set; }
InkDrawingAttributes DrawingAttributes();

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

Property Value


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


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.

inkManager.getStrokes().forEach(function (stroke)
  var drawingAttributes = stroke.drawingAttributes;
  drawingAttributes.penTip = 
  stroke.drawingAttributes = drawingAttributes;

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

For the complete example, see Ink App sample.

See also