InkStrokeBuilder InkStrokeBuilder InkStrokeBuilder InkStrokeBuilder Class

Definition

Builds strokes from raw pointer input.

Note

For Universal Windows app using Extensible Application Markup Language (XAML), we recommend using InkPresenter and the InkCanvas control instead of InkManager.

Use CreateStrokeFromInkPoints and SetDefaultDrawingAttributes to programmatically build strokes for an InkPresenter.

public : sealed class InkStrokeBuilder : IInkStrokeBuilder, IInkStrokeBuilder2, IInkStrokeBuilder3public sealed class InkStrokeBuilder : IInkStrokeBuilder, IInkStrokeBuilder2, IInkStrokeBuilder3Public NotInheritable Class InkStrokeBuilder Implements IInkStrokeBuilder, IInkStrokeBuilder2, IInkStrokeBuilder3// You can use this class in JavaScript.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

Note

: This class is not agile, which means that you need to consider its threading model and marshaling behavior. For more info, see Threading and Marshaling (C++/CX) and Using Windows Runtime objects in a multithreaded environment (.NET).

Constructors

InkStrokeBuilder() InkStrokeBuilder() InkStrokeBuilder() InkStrokeBuilder()

Creates a new InkStrokeBuilder object that is used to construct InkStroke objects.

Note

For Universal Windows app using Extensible Application Markup Language (XAML), we recommend using InkPresenter and the InkCanvas control instead of InkManager.

Use CreateStrokeFromInkPoints and SetDefaultDrawingAttributes to programmatically build strokes for an InkPresenter.

public : InkStrokeBuilder()public InkStrokeBuilder()Public Sub New()// You can use this method in JavaScript.
See Also

Methods

AppendToStroke(PointerPoint) AppendToStroke(PointerPoint) AppendToStroke(PointerPoint) AppendToStroke(PointerPoint)

Adds a new segment to the ink stroke.

AppendToStroke is called after BeginStroke and before EndStroke during the InkStroke building process.

Note

AppendToStroke is not supported by InkPresenter. Use CreateStrokeFromInkPoints and SetDefaultDrawingAttributes to programmatically build strokes for an InkPresenter.

public : PointerPoint AppendToStroke(PointerPoint pointerPoint)public PointerPoint AppendToStroke(PointerPoint pointerPoint)Public Function AppendToStroke(pointerPoint As PointerPoint) As PointerPoint// You can use this method in JavaScript.
Parameters
pointerPoint
PointerPoint PointerPoint PointerPoint PointerPoint

The end point of the new segment.

Returns

The previous end point. This end point can be used when rendering the stroke.

See Also

BeginStroke(PointerPoint) BeginStroke(PointerPoint) BeginStroke(PointerPoint) BeginStroke(PointerPoint)

Starts building the ink stroke.

Note

BeginStroke is not supported by InkPresenter. Use CreateStrokeFromInkPoints and SetDefaultDrawingAttributes to programmatically build strokes for an InkPresenter.

public : void BeginStroke(PointerPoint pointerPoint)public void BeginStroke(PointerPoint pointerPoint)Public Function BeginStroke(pointerPoint As PointerPoint) As void// You can use this method in JavaScript.
Parameters
pointerPoint
PointerPoint PointerPoint PointerPoint PointerPoint

The first point for the stroke.

See Also

CreateStroke(IIterable) CreateStroke(IIterable) CreateStroke(IIterable) CreateStroke(IIterable)

Creates a stroke from an array of Point coordinates.

Note

CreateStroke is not supported by InkPresenter. Use CreateStrokeFromInkPoints and SetDefaultDrawingAttributes to programmatically build strokes for an InkPresenter.

public : InkStroke CreateStroke(IIterable<Point> points)public InkStroke CreateStroke(IEnumerable<Point> points)Public Function CreateStroke(points As IEnumerable<Point>) As InkStroke// You can use this method in JavaScript.
Parameters
points
IIterable<Point> IEnumerable<Point> IEnumerable<Point> IEnumerable<Point>

An array of Point coordinates.

Returns
See Also

CreateStrokeFromInkPoints(IIterable, Matrix3x2) CreateStrokeFromInkPoints(IIterable, Matrix3x2) CreateStrokeFromInkPoints(IIterable, Matrix3x2) CreateStrokeFromInkPoints(IIterable, Matrix3x2)

Creates a basic ink stroke from collection of InkPoint objects.

Note

Use CreateStrokeFromInkPoints and SetDefaultDrawingAttributes to programmatically build strokes for an InkPresenter.

public : InkStroke CreateStrokeFromInkPoints(IIterable<InkPoint> inkPoints, Matrix3x2 transform)public InkStroke CreateStrokeFromInkPoints(IEnumerable<InkPoint> inkPoints, Matrix3x2 transform)Public Function CreateStrokeFromInkPoints(inkPoints As IEnumerable<InkPoint>, transform As Matrix3x2) As InkStroke// You can use this method in JavaScript.
Parameters
inkPoints
IIterable<InkPoint> IEnumerable<InkPoint> IEnumerable<InkPoint> IEnumerable<InkPoint>

The collection of InkPoint objects.

transform
Matrix3x2 Matrix3x2 Matrix3x2 Matrix3x2

A 2-D transformation matrix.

Returns

The ink stroke, including the Bézier curve parameters used for final rendering of the stroke.

CreateStrokeFromInkPoints(IIterable, Matrix3x2, IReference, IReference) CreateStrokeFromInkPoints(IIterable, Matrix3x2, IReference, IReference) CreateStrokeFromInkPoints(IIterable, Matrix3x2, IReference, IReference) CreateStrokeFromInkPoints(IIterable, Matrix3x2, IReference, IReference)

Creates a rich ink stroke from collection of InkPoint objects.

Note

Use CreateStrokeFromInkPoints and SetDefaultDrawingAttributes to programmatically build strokes for an InkPresenter.

public : InkStroke CreateStrokeFromInkPoints(IIterable<InkPoint> inkPoints, Matrix3x2 transform, IReference<DateTime> strokeStartedTime, IReference<TimeSpan> strokeDuration)public InkStroke CreateStrokeFromInkPoints(IEnumerable<InkPoint> inkPoints, Matrix3x2 transform, Nullable<DateTimeOffset> strokeStartedTime, Nullable<TimeSpan> strokeDuration)Public Function CreateStrokeFromInkPoints(inkPoints As IEnumerable<InkPoint>, transform As Matrix3x2, strokeStartedTime As Nullable<DateTimeOffset>, strokeDuration As Nullable<TimeSpan>) As InkStroke// You can use this method in JavaScript.
Parameters
inkPoints
IIterable<InkPoint> IEnumerable<InkPoint> IEnumerable<InkPoint> IEnumerable<InkPoint>

The collection of InkPoint objects.

transform
Matrix3x2 Matrix3x2 Matrix3x2 Matrix3x2

A 2-D transformation matrix. Typically, this is just the identity matrix.

strokeStartedTime
IReference<DateTime> Nullable<DateTimeOffset> Nullable<DateTimeOffset> Nullable<DateTimeOffset>

The date and time when the InkStroke was started.

strokeDuration
IReference<TimeSpan> Nullable<TimeSpan> Nullable<TimeSpan> Nullable<TimeSpan>

Gets or sets the time taken by the user to draw a single ink stroke.

Returns

The ink stroke, including the Bézier curve parameters used for final rendering of the stroke.

Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

EndStroke(PointerPoint) EndStroke(PointerPoint) EndStroke(PointerPoint) EndStroke(PointerPoint)

Stops building the ink stroke.

Note

EndStroke is not supported by InkPresenter. Use CreateStrokeFromInkPoints and SetDefaultDrawingAttributes to programmatically build strokes for an InkPresenter.

public : InkStroke EndStroke(PointerPoint pointerPoint)public InkStroke EndStroke(PointerPoint pointerPoint)Public Function EndStroke(pointerPoint As PointerPoint) As InkStroke// You can use this method in JavaScript.
Parameters
pointerPoint
PointerPoint PointerPoint PointerPoint PointerPoint

The last point for the stroke.

Returns

The stroke built from the points.

See Also

SetDefaultDrawingAttributes(InkDrawingAttributes) SetDefaultDrawingAttributes(InkDrawingAttributes) SetDefaultDrawingAttributes(InkDrawingAttributes) SetDefaultDrawingAttributes(InkDrawingAttributes)

Sets the default InkDrawingAttributes for all new ink strokes created after the current stroke.

SetDefaultDrawingAttributes does not affect the current stroke, or any existing strokes.

Note

Use SetDefaultDrawingAttributes when programmatically building strokes for both InkPresenter and InkManager objects.

public : void SetDefaultDrawingAttributes(InkDrawingAttributes drawingAttributes)public void SetDefaultDrawingAttributes(InkDrawingAttributes drawingAttributes)Public Function SetDefaultDrawingAttributes(drawingAttributes As InkDrawingAttributes) As void// You can use this method in JavaScript.
Parameters
See Also

See Also