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

Definition

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

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.

inkManager.getStrokes().forEach(function (stroke)
{
  var drawingAttributes = stroke.drawingAttributes;
  drawingAttributes.penTip = 
       Windows.UI.Input.Inking.PenTipShape.rectangle;
  stroke.drawingAttributes = drawingAttributes;
}

// 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;

For the complete example, see Ink App sample.

See Also