Delen via


InkStrokeContainer Class

Definition

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.

public ref class InkStrokeContainer sealed : IInkStrokeContainer
/// [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 InkStrokeContainer final : IInkStrokeContainer
/// [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 InkStrokeContainer final : IInkStrokeContainer
[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 InkStrokeContainer : IInkStrokeContainer
[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 InkStrokeContainer : IInkStrokeContainer
function InkStrokeContainer()
Public NotInheritable Class InkStrokeContainer
Implements IInkStrokeContainer
Inheritance
Object Platform::Object IInspectable InkStrokeContainer
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)

Remarks

For ink recognition, use an InkRecognizerContainer object.

The StrokesCollected event is fired when ink strokes are processed ("wet" to "dry") on the UI thread.

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

Version history

Windows version SDK version Value added
1703 15063 GetStrokeById
1703 15063 SaveAsync(IOutputStream,InkPersistenceFormat)

Constructors

InkStrokeContainer()

Initializes a new InkStrokeContainer object that is used to manage InkStroke objects.

Properties

BoundingRect

Gets the bounding rectangle of the InkStroke collection managed by the InkStrokeContainer.

Methods

AddStroke(InkStroke)

Adds an InkStroke object to the collection managed by the InkStrokeContainer.

An InkStroke cannot exist in more than one InkStrokeContainer. Call the Clone method to duplicate a stroke in another container.

AddStrokes(IIterable<InkStroke>)

Adds one or more ink strokes to the collection managed by the InkStrokeContainer.

An InkStroke cannot exist in more than one InkStrokeContainer. Call the Clone method to duplicate a stroke in another container.

CanPasteFromClipboard()

Identifies whether content on the clipboard can be added to the InkStroke collection managed by the InkStrokeContainer.

Note

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

Clear()

Deletes all InkStroke objects from the collection managed by the InkStrokeContainer.

CopySelectedToClipboard()

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

DeleteSelected()

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

GetRecognitionResults()

Gets the collection of recognition matches previously processed by an InkRecognizer and stored in an InkRecognizerContainer.

Recognition is not supported by InkStrokeContainer, you must use an InkRecognizerContainer object.

GetStrokeById(UInt32)

Retrieves the single InkStroke with the specified ID.

GetStrokes()

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

LoadAsync(IInputStream)

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

All existing strokes in the InkStrokeContainer are cleared before new strokes are loaded.

MoveSelected(Point)

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

PasteFromClipboard(Point)

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

SaveAsync(IOutputStream, InkPersistenceFormat)

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

SaveAsync(IOutputStream)

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

SelectWithLine(Point, Point)

Selects all strokes intersected by the new stroke.

Note

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

SelectWithPolyLine(IIterable<Point>)

Selects all strokes contained entirely within the polyline.

Note

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

.

UpdateRecognitionResults(IVectorView<InkRecognitionResult>)

Updates the collection of recognition matches previously processed by an InkRecognizer and stored in an InkRecognizerContainer.

Recognition is not supported by InkStrokeContainer, you must use an InkRecognizerContainer object.

Applies to

See also