InkStroke InkStroke InkStroke InkStroke InkStroke Class


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

public : sealed class InkStroke
struct winrt::Windows::UI::Input::Inking::InkStroke
public sealed class InkStroke
Public NotInheritable Class InkStroke
// This class does not provide a public constructor.

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)


Here we iterate through each stroke in an InkManager and process them for final rendering using Bézier curves.

// Iterate through each stroke.
    function (stroke)
        if (stroke.selected) {
            inkContext.lineWidth = stroke.drawingAttributes.size.width * 2;
            inkContext.strokeStyle = "green";
        } else {
            inkContext.lineWidth = stroke.drawingAttributes.size.width;
            inkContext.strokeStyle = "black";

        // Enumerate through each line segment of the stroke.
        var first = true;

            function (segment)
                // Move to the starting screen location of the stroke.
                if (first)
                    inkContext.moveTo(segment.position.x, segment.position.y);
                    first = false;
                // Calculate the bezier curve for the segment.
                                             segment.position.x, segment.position.y);
        // Draw the stroke.


JavaScript (usage)
var inkStrokes = @Windows.UI.Input.Inking.InkManager.GetStrokes?text=Windows.UI.Input.Inking.InkManager.getStrokes;

var inkStroke = inkStrokes[...];

var inkStrokes = @Windows.UI.Input.Inking.InkRecognitionResult.GetStrokes?text=Windows.UI.Input.Inking.inkRecognitionResult.getStrokes;

var inkStroke = inkStrokes[...];

var inkStrokes = @Windows.UI.Input.Inking.InkStrokeContainer.GetStrokes?text=Windows.UI.Input.Inking.inkStrokeContainer.getStrokes;

var inkStroke = inkStrokes[...];


: 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).

Version history

Windows version SDK version Value added
1703 15063 Id
1703 15063 StrokeDuration
1703 15063 StrokeStartedTime


BoundingRect BoundingRect BoundingRect BoundingRect BoundingRect

Gets the bounding box for the InkStroke.

DrawingAttributes DrawingAttributes DrawingAttributes DrawingAttributes DrawingAttributes

Gets or sets the properties associated with an InkStroke.

Id Id Id Id Id

Gets the ink stroke identifier.

A unique identifier is assigned to each ink stroke managed by the InkPresenter.

PointTransform PointTransform PointTransform PointTransform PointTransform

Gets or sets an affine transformation matrix to apply to the InkStroke object.

Recognized Recognized Recognized Recognized Recognized

Gets whether the stroke is recognized.

Selected Selected Selected Selected Selected

Gets whether the stroke is selected.

StrokeDuration StrokeDuration StrokeDuration StrokeDuration StrokeDuration

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

StrokeStartedTime StrokeStartedTime StrokeStartedTime StrokeStartedTime StrokeStartedTime

Gets or sets the date and time when the InkStroke was started.


Clone() Clone() Clone() Clone() Clone()

Copies the InkStroke to another InkManager (or InkStrokeContainer ).

GetInkPoints() GetInkPoints() GetInkPoints() GetInkPoints() GetInkPoints()

Gets the collection of InkPoint objects used to construct the InkStroke.

GetRenderingSegments() GetRenderingSegments() GetRenderingSegments() GetRenderingSegments() GetRenderingSegments()

Gets the rendering segments of the stroke.


For Universal Windows app using Extensible Application Markup Language (XAML), use GetInkPoints (see remarks).

See also