InkStroke.DrawingAttributes 属性

定义

获取或设置与 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

属性值

绘图属性。

示例

以下示例演示如何为特定笔划设置绘图属性。

注意

不能直接设置笔划的 DrawingAttributes 属性。 必须创建笔划的 InkDrawingAttributes 的副本,为该 InkDrawingAttributes 对象设置所需的值,然后将新的 InkDrawingAttributes 分配给笔划的 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;

适用于

另请参阅