Ink​Stroke​Builder Ink​Stroke​Builder Ink​Stroke​Builder 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
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()

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()
Attributes
See Also

Methods

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
Parameters
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.

Attributes
See Also

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
Parameters
pointerPoint
PointerPoint PointerPoint PointerPoint

The first point for the stroke.

Attributes
See Also

CreateStroke(IIterable<Point>) CreateStroke(IIterable<Point>) CreateStroke(IIterable<Point>)

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
Parameters
points
IIterable<Point> IEnumerable<Point> IEnumerable<Point>

An array of Point coordinates.

Returns

The new stroke.

Attributes
See Also

CreateStrokeFromInkPoints(IIterable<InkPoint>, Matrix3x2) CreateStrokeFromInkPoints(IIterable<InkPoint>, Matrix3x2) CreateStrokeFromInkPoints(IIterable<InkPoint>, 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
Parameters
inkPoints
IIterable<InkPoint> IEnumerable<InkPoint> IEnumerable<InkPoint>

The collection of InkPoint objects.

transform
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.

Attributes

CreateStrokeFromInkPoints(IIterable<InkPoint>, Matrix3x2, IReference<DateTime>, IReference<TimeSpan>) CreateStrokeFromInkPoints(IIterable<InkPoint>, Matrix3x2, IReference<DateTime>, IReference<TimeSpan>) CreateStrokeFromInkPoints(IIterable<InkPoint>, Matrix3x2, IReference<DateTime>, IReference<TimeSpan>)

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
Parameters
inkPoints
IIterable<InkPoint> IEnumerable<InkPoint> IEnumerable<InkPoint>

The collection of InkPoint objects.

transform
Matrix3x2 Matrix3x2 Matrix3x2

A 2-D transformation matrix.

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

The date and time when the InkStroke was started.

strokeDuration
IReference<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.

Attributes
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)

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
Parameters
pointerPoint
PointerPoint PointerPoint PointerPoint

The last point for the stroke.

Returns

The stroke built from the points.

Attributes
See Also

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
Parameters
drawingAttributes
InkDrawingAttributes InkDrawingAttributes InkDrawingAttributes

The default attributes.

Attributes
See Also

See Also