共用方式為


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;

適用於

另請參閱