InkDrawingAttributes 類別

定義

提供與 InkStroke繪圖相關聯的屬性。

public ref class InkDrawingAttributes sealed
/// [Windows.Foundation.Metadata.Activatable(65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class InkDrawingAttributes final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
class InkDrawingAttributes final
[Windows.Foundation.Metadata.Activatable(65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class InkDrawingAttributes
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
public sealed class InkDrawingAttributes
function InkDrawingAttributes()
Public NotInheritable Class InkDrawingAttributes
繼承
Object Platform::Object IInspectable InkDrawingAttributes
屬性

Windows 需求

裝置系列
Windows 10 (已於 10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v1.0 引進)

範例

下列範例示範如何為 InkManager 物件所管理的所有筆劃設定預設繪圖屬性, (inkManager) 。

// Create the InkManager instance.
Windows.UI.Input.Inking.InkManager inkManager = 
  new Windows.UI.Input.Inking.InkManager();
Windows.UI.Input.Inking.InkDrawingAttributes drawingAttributes = 
  new Windows.UI.Input.Inking.InkDrawingAttributes();
// True is the Default value for fitToCurve.
drawingAttributes.FitToCurve = false;
// Set color to red (default is black).
drawingAttributes.Color = Windows.UI.Colors.CornflowerBlue;
inkManager.SetDefaultDrawingAttributes(drawingAttributes);

下列範例示範如何設定特定筆劃的繪圖屬性。

注意

您無法直接設定筆劃的 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;

備註

InkDrawingAttributes 可以透過InkManager物件的SetDefaultDrawingAttributes方法或InkStrokeBuilder物件全域設定。 您也可以透過DrawingAttributes屬性,在個別InkStroke物件上設定它們。

版本歷程記錄

Windows 版本 SDK 版本 新增值
1607 14393 CreateForPencil
1607 14393 種類
1607 14393 PencilProperties
1703 15063 IgnoreTilt
1803 17134 ModelerAttributes

建構函式

InkDrawingAttributes()

建立用來指定InkStroke屬性的新InkDrawingAttributes物件。

屬性

Color

取得或設定值,這個值表示 InkStroke的色彩。

DrawAsHighlighter

取得或設定值,這個值表示 InkStroke 是否轉譯為醒目提示器重迭。 筆劃通常會設定為亮色,例如黃色。

FitToCurve

取得或設定值,這個值表示是否使用 Bezier 曲線或直線線段的集合來繪製 InkStroke

IgnorePressure

取得或設定值,這個值表示當您繪製 InkStroke時,是否會忽略數位板介面上的接觸壓力。

IgnoreTilt

取得或設定值,這個值表示當您繪製InkStroke時,是否忽略數位板介面上接觸的傾斜 (傾斜、傾斜) 。

Kind

取得描述特定InkStroke類型特性的InkDrawingAttributes

ModelerAttributes

取得 ModelerAttributes 物件的實例,以存取筆跡筆劃的模型工具屬性。

PencilProperties

取得 InkDrawingAttributesPencilProperties 物件的實例,以將屬性特性設定為鉛筆筆劃。

PenTip

取得或設定值,指出繪製 InkStroke時手寫筆提示的形狀。

PenTipTransform

取得或設定套用至InkStroke所用PenTipShape的 affine 轉換矩陣。

Size

取得或設定值,這個值表示用來繪製InkStroke的畫筆提示 (筆提示) 維度。

方法

CreateForPencil()

建立 InkDrawingAttributes 物件,以轉譯具有鉛筆特性的筆墨筆劃。

適用於

另請參閱