Sdílet prostřednictvím


InkManager Class

Definition

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.

public ref class InkManager 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.None)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class InkManager final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.None)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
class InkManager 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.None)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class InkManager
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.None)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
public sealed class InkManager
function InkManager()
Public NotInheritable Class InkManager
Inheritance
Object Platform::Object IInspectable InkManager
Attributes
Implements

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

Examples

This example shows how to create an InkManager object.

var inkManager = new Windows.UI.Input.Inking.InkManager();

The following function demonstrates how to select all ink strokes on a canvas that are part of the stroke collection of this InkManager (inkManager).

function selectAll()
{
    inkManager.getStrokes().forEach(
        function (stroke) 
        {
            stroke.selected = 1;
        }
    );
}

Remarks

If recognition is not required, use an InkStrokeContainer object instead of an InkManager. Previous recognition results are still available through GetRecognitionResults.

If only recognition is required, and not storage, use an InkRecognizerContainer instead of an InkManager.

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

InkManager()

Note

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

Creates a new InkManager object that is used to manage InkStroke objects.

Properties

BoundingRect

Note

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

Gets the bounding rectangle of the InkStroke collection that is managed by the InkManager.

Mode

Note

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

Gets or sets the ink input mode.

Methods

AddStroke(InkStroke)

Note

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

Adds one or more InkStroke objects to the collection managed by the InkManager.

CanPasteFromClipboard()

Note

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

Identifies whether content on the clipboard can be added to the InkStroke collection that is managed by the InkManager.

Note

Clipboard content must be in Ink Serialized Format (ISF).

CopySelectedToClipboard()

Note

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

Copies the selected InkStroke objects (from the InkStroke collection managed by the InkManager) to the clipboard in Ink Serialized Format (ISF) format.

DeleteSelected()

Note

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

Deletes the selected InkStroke objects from the InkStroke collection managed by the InkManager.

GetRecognitionResults()

Note

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

Retrieves the collection of words returned by handwriting recognition.

GetRecognizers()

Note

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

Gets the collection of installed handwriting recognizers.

GetStrokes()

Note

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

Retrieves all ink strokes in the collection managed by the InkManager.

LoadAsync(IInputStream)

Note

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

Asynchronously loads all InkStroke objects from the specified stream to the InkStroke collection that is managed by the InkManager.

Ink data is serialized as Ink Serialized Format (ISF) metadata and embedded into a Graphics Interchange Format (GIF) file.

MoveSelected(Point)

Note

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

Moves the selected strokes. All affected strokes are re-rendered.

PasteFromClipboard(Point)

Note

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

Adds the InkStroke content from the clipboard to the InkStroke collection that is managed by the InkManager and renders the new strokes..

ProcessPointerDown(PointerPoint)

Note

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

Processes information about the position and features of the contact point, like pressure and tilt, on initial down contact. You must call this method before you call ProcessPointerUpdate, and then ProcessPointerUp.

Important

This method is not supported in desktop apps.

ProcessPointerUp(PointerPoint)

Note

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

Processes information about the position and features of the contact point, like pressure and tilt, on up contact. You must call this method after you call ProcessPointerUpdate.

Important

This method is not supported in desktop apps.

ProcessPointerUpdate(PointerPoint)

Note

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

Processes position and state properties, such as pressure and tilt, for the specified pointer, from the last pointer event up to and including the current pointer event.Call this method after ProcessPointerDown and before ProcessPointerUp.

Important

This method is not supported in desktop apps.

RecognizeAsync(InkRecognitionTarget)

Note

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

Performs handwriting recognition on one or more InkStroke objects.

RecognizeAsync(InkStrokeContainer, InkRecognitionTarget)

Note

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

Performs handwriting recognition on one or more InkStroke objects.

SaveAsync(IOutputStream)

Note

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

Asynchronously saves all InkStroke objects in the InkStroke collection that is managed by the InkManager to the specified stream.

Ink data is serialized as Ink Serialized Format (ISF) metadata and embedded into a Graphics Interchange Format (GIF) file.

SelectWithLine(Point, Point)

Note

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

Selects all strokes intersected by the new stroke.

Note

The Selected flag is reset for all other strokes in the collection.

SelectWithPolyLine(IIterable<Point>)

Note

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

Selects all strokes contained entirely within the polyline.

Note

The Selected flag is reset for all other strokes in the collection.

.

SetDefaultDrawingAttributes(InkDrawingAttributes)

Note

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

Sets the default InkDrawingAttributes for all new InkStroke objects added to the InkStroke collection managed by the InkManager.

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

SetDefaultRecognizer(InkRecognizer)

Note

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

Sets the default InkRecognizer used for handwriting recognition.

UpdateRecognitionResults(IVectorView<InkRecognitionResult>)

Note

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

Updates the collection of potential text matches from handwriting recognition.

Applies to

See also