Windows.UI.Input.Inking Namespace

Provides input, processing, and management support for Windows Ink apps. This includes:

  • Drawing ink strokes.
  • Capturing strokes.
  • Rendering strokes.
  • Selecting strokes.
  • Deleting strokes.
  • Saving and loading strokes.
  • Converting strokes to text through handwriting recognition.
  • Copying and pasting strokes from the clipboard.
  • Hit testing (or stroke targeting).

Classes

InkDrawingAttributes

Provides properties associated with the drawing of an InkStroke.

InkDrawingAttributesPencilProperties

Provides a set of static InkDrawingAttributes properties for rendering a pencil stroke on an InkCanvas.

Get an instance of this class by calling InkDrawingAttributes.CreateForPencil and accessing InkDrawingAttributes.PencilProperties.

InkInputConfiguration

Manages which types of secondary input can be processed by the InkPresenter object.

InkInputProcessingConfiguration

Manages how input is processed by the InkPresenter object.

InkManager

Note

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

Manages the input, manipulation, and processing (including handwriting recognition) of one or more InkStroke objects.

InkModelerAttributes

Manages which types of ink modeler attributes can be processed by the InkPresenter object.

InkPoint

Provides raw input data for a single point used in the construction of an InkStroke.

InkPresenter

Provides properties, methods, and events for managing the input, processing, and rendering of ink input (standard and modified) for an InkCanvas control.

InkPresenterProtractor

Represents a visual stencil, in the form of a protractor for drawing arcs and curves, displayed as a semi-transparent overlay on an InkCanvas.

The stencil transforms how an ink stroke is rendered:

  • It snaps the ink stroke to the stencil edge if the pen tip is within a distance threshold (gutter).
  • It acts as a mask and prevents the drawing of an ink stroke within the area obscured by the stencil.

The InkPresenterRuler can be manipulated both programmatically and by the user. It also scales and translates with the InkCanvas.

InkPresenterRuler

Represents a visual stencil, in the form of a straight rule for drawing straight lines, displayed as a semi-transparent overlay on an InkCanvas.

The stencil transforms how an ink stroke is rendered:

  • It snaps the ink stroke to the stencil edge if the pen tip is within a distance threshold (gutter).
  • It acts as a mask and prevents the drawing of an ink stroke within the area obscured by the stencil.

The InkPresenterRuler can be manipulated both programmatically and by the user. It also scales and translates with the InkCanvas.

InkRecognitionResult

Provides properties and methods to manage InkStroke handwriting recognition data.

Recognition results are produced for each word detected by an InkRecognizer.

InkRecognizer

Manages all aspects of handwriting recognition.

InkRecognizerContainer

Provides properties and methods to manage one or more InkRecognizer objects used for handwriting recognition.

InkRecognizerContainer is null if a recognition engine is not available on the system.

InkStroke

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

InkStrokeBuilder

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.

InkStrokeContainer

Provides properties and methods to store and manage the collection of InkStroke objects rendered by the InkPresenter.

Modifications made to any of the ink strokes in the stroke container are immediately rendered to the drawing surface associated with the InkPresenter.

InkStrokeInput

Provides properties and events for StrokeInput associated with an InkPresenter object.

InkStrokeRenderingSegment

A single segment of a complete ink stroke.

A single segment consists of a starting point, an ending point, and two Bezier control points. However, for a series of segments that make up a stroke, the last point of the previous segment is the first point of the current segment. This means that only the ending point for each segment is required to represent a complete stroke.

Each stroke is a vector of InkStrokeRenderingSegment objects with the first segment identified by a single starting point and all remaining segments identified by an ending point and two Bezier control points.

InkStrokesCollectedEventArgs

Contains event data for the StrokesCollected event of the InkPresenter associated with an InkCanvas control.

By default, an ink stroke is processed on a low-latency background thread and rendered wet as it is drawn. When the stroke is completed (pen or finger lifted, or mouse button released), the stroke is processed on the UI thread and rendered dry to the InkCanvas layer (above the application content). If the UI thread is busy, more than one ink stroke might be processed (collected) when the thread becomes available.

This behavior can be overridden by calling the ActivateCustomDrying method prior to loading the InkCanvas.

InkStrokesErasedEventArgs

Contains event data for the StrokesErased event of the InkPresenter associated with an InkCanvas control.

By default, ink stroke data and rendering is managed entirely by the InkCanvas control. However, this behavior can be overridden by calling the ActivateCustomDrying method prior to loading the InkCanvas.

InkSynchronizer

Manages the synchronization of ink input and provides methods for rendering it to the Direct2D device context of your Universal Windows app, instead of the default InkCanvas control. This requires an IInkD2DRenderer object to manage the ink input (see the Complex ink sample).

By default, ink input is processed on a low-latency background thread and rendered "wet" as it is drawn. When the stroke is completed (pen or finger lifted, or mouse button released), the stroke is processed on the UI thread and rendered "dry" to the InkCanvas layer (above the application content and replacing the wet ink).

By calling ActivateCustomDrying (before the InkCanvas is loaded), an app creates an InkSynchronizer object to customize how an ink stroke is rendered dry to a SurfaceImageSource or VirtualSurfaceImageSource. For example, an ink stroke could be rasterized and integrated into application content instead of as a separate InkCanvas layer.

InkUnprocessedInput

Provides properties and events for custom processing of ink data from an InkCanvas control. The data is not processed by the InkPresenter.

Use InkInputProcessingConfiguration to identify the data to pass through as UnprocessedInput.

PenAndInkSettings

Provides access to user settings related to accepting and converting ink to text input in a text control (when HandwritingView is enabled).

Interfaces

IInkPointFactory

Defines the implementation for a type that generates InkPoint objects used in the construction of an InkStroke.

IInkPresenterRulerFactory

Defines the implementation for a type that generates InkPresenterRuler objects used in the construction of an InkPresenter.

IInkPresenterStencil

Represents a visual stencil, displayed as an semi-transparent overlay on an InkCanvas.

The stencil transforms how an ink stroke is rendered:

  • It snaps the ink stroke to the stencil edge if the pen tip is within a distance threshold (gutter).
  • It acts as a mask and prevents the drawing of an ink stroke within the area obscured by the stencil.

The stencil can be manipulated both programmatically and by the user. It also scales and translates with the InkCanvas.

IInkRecognizerContainer

Represents one or more InkRecognizer objects.

IInkStrokeContainer

Represents a manager for the collection of InkStroke objects rendered by the InkPresenter.

Modifications made to any of the ink strokes in the stroke container are immediately rendered to the drawing surface associated with the InkPresenter.

Enums

HandwritingLineHeight

Specifies the handwriting space available when using ink for text input in a text control (when HandwritingView is enabled).

InkDrawingAttributesKind

Specifies the type of InkDrawingAttributes associated with the InkStroke.

InkHighContrastAdjustment

Specifies how the InkPresenter object handles input (standard and modified) from the associated InkCanvas control when system is in high contrast mode.

InkInputProcessingMode

Specifies how the InkPresenter object interprets input from its associated InkCanvas control.

By default, input is handled as standard ink or erase strokes, or it can be passed as UnprocessedInput to your app for custom processing.

InkInputRightDragAction

Specifies how the InkPresenter object handles secondary input from a pen barrel button, pen eraser tip, right mouse button, or similar.

By default, this secondary input is processed as primary input and rendered as an InkStroke (see remarks).

InkManipulationMode

Specifies the modes of ink input.

InkPersistenceFormat

Specifies the formats for saving ink input.

InkPresenterPredefinedConfiguration

Specifies the inking behavior of one or more contact points. Used with SetPredefinedConfiguration.

InkPresenterStencilKind

Specifies the type of stencil that can be displayed on an InkCanvas.

InkRecognitionTarget

Indicates which strokes you want to include in handwriting recognition.

PenHandedness

Identifies the preferred writing hand, as specified by the user in Settings -> Devices -> Pen & Windows Ink -> Choose which hand you write with.

PenTipShape

Identifies the shape of the PenTip.

See also