InkStrokeContainer InkStrokeContainer InkStrokeContainer InkStrokeContainer Class

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.

Syntax

Declaration

public sealed class InkStrokeContainerpublic sealed class InkStrokeContainerPublic NotInheritable Class InkStrokeContainer

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

Constructors summary

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

Properties summary

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

Methods summary

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.

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.

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

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

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

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

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.

Prerelease. Retrieves the single InkStroke with the specified ID.

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

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.

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

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

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

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

Selects all strokes intersected by the new stroke.

Note

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

Selects all strokes contained entirely within the polyline.

Note

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

.

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.

Constructors

  • InkStrokeContainer()
    InkStrokeContainer()
    InkStrokeContainer()
    InkStrokeContainer()

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

    public InkStrokeContainer()public InkStrokeContainer()Public Function InkStrokeContainer() As

Properties

  • BoundingRect
    BoundingRect
    BoundingRect
    BoundingRect

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

    public Rect BoundingRect { get; }public Rect BoundingRect { get; }Public ReadOnly Property BoundingRect As Rect

    Property Value

Methods

  • AddStroke(Windows.UI.Input.Inking.InkStroke)
    AddStroke(Windows.UI.Input.Inking.InkStroke)
    AddStroke(Windows.UI.Input.Inking.InkStroke)
    AddStroke(Windows.UI.Input.Inking.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.

    public void AddStroke(Windows.UI.Input.Inking.InkStroke stroke)public void AddStroke(Windows.UI.Input.Inking.InkStroke stroke)Public Function AddStroke(stroke As Windows.UI.Input.Inking.InkStroke) As void

    Parameters

  • AddStrokes(Windows.Foundation.Collections.IIterable{Windows.UI.Input.Inking.InkStroke})
    AddStrokes(Windows.Foundation.Collections.IIterable{Windows.UI.Input.Inking.InkStroke})
    AddStrokes(Windows.Foundation.Collections.IIterable{Windows.UI.Input.Inking.InkStroke})
    AddStrokes(Windows.Foundation.Collections.IIterable{Windows.UI.Input.Inking.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.

    public void AddStrokes(Windows.Foundation.Collections.IIterable{Windows.UI.Input.Inking.InkStroke} strokes)public void AddStrokes(Windows.Foundation.Collections.IIterable{Windows.UI.Input.Inking.InkStroke} strokes)Public Function AddStrokes(strokes As Windows.Foundation.Collections.IIterable{Windows.UI.Input.Inking.InkStroke}) As void

    Parameters

  • CanPasteFromClipboard()
    CanPasteFromClipboard()
    CanPasteFromClipboard()
    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).

    public bool CanPasteFromClipboard()public bool CanPasteFromClipboard()Public Function CanPasteFromClipboard() As bool

    Returns

    • bool
      bool
      bool
      bool

      True if content can be pasted from the clipboard; otherwise, false.

  • Clear()
    Clear()
    Clear()
    Clear()

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

    public void Clear()public void Clear()Public Function Clear() As void
  • CopySelectedToClipboard()
    CopySelectedToClipboard()
    CopySelectedToClipboard()
    CopySelectedToClipboard()

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

    public void CopySelectedToClipboard()public void CopySelectedToClipboard()Public Function CopySelectedToClipboard() As void
  • DeleteSelected()
    DeleteSelected()
    DeleteSelected()
    DeleteSelected()

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

    public Rect DeleteSelected()public Rect DeleteSelected()Public Function DeleteSelected() As Rect

    Returns

    • The bounding rectangle of the selected ink strokes, or the invalidated rectangle (0, 0, 0, 0) if no strokes were removed (no selected strokes).

    Remarks

    This method does not cause the StrokesErased event to fire.

  • GetRecognitionResults()
    GetRecognitionResults()
    GetRecognitionResults()
    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.

    public IVectorView<InkRecognitionResult> GetRecognitionResults()public IVectorView<InkRecognitionResult> GetRecognitionResults()Public Function GetRecognitionResults() As IVectorView( Of InkRecognitionResult )

    Returns

  • GetStrokeById(System.UInt32)
    GetStrokeById(System.UInt32)
    GetStrokeById(System.UInt32)
    GetStrokeById(System.UInt32)

    Prerelease. Retrieves the single InkStroke with the specified ID.

    public InkStroke GetStrokeById(System.UInt32 id)public InkStroke GetStrokeById(System.UInt32 id)Public Function GetStrokeById(id As System.UInt32) As InkStroke

    Parameters

    • id
      System.UInt32
      System.UInt32
      System.UInt32
      System.UInt32

      The Global Unique Identifier (GUID) used to identify a single ink stroke.

    Returns

  • GetStrokes()
    GetStrokes()
    GetStrokes()
    GetStrokes()

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

    public IVectorView<InkStroke> GetStrokes()public IVectorView<InkStroke> GetStrokes()Public Function GetStrokes() As IVectorView( Of InkStroke )

    Returns

  • LoadAsync(Windows.Storage.Streams.IInputStream)
    LoadAsync(Windows.Storage.Streams.IInputStream)
    LoadAsync(Windows.Storage.Streams.IInputStream)
    LoadAsync(Windows.Storage.Streams.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.

    public IAsyncActionWithProgress<ulong> LoadAsync(Windows.Storage.Streams.IInputStream inputStream)public IAsyncActionWithProgress<ulong> LoadAsync(Windows.Storage.Streams.IInputStream inputStream)Public Function LoadAsync(inputStream As Windows.Storage.Streams.IInputStream) As IAsyncActionWithProgress( Of ulong )

    Parameters

    Returns

    • The status of the asynchronous operation as the number of bytes fetched. For more information, see ReadAsync method.

  • MoveSelected(Windows.Foundation.Point)
    MoveSelected(Windows.Foundation.Point)
    MoveSelected(Windows.Foundation.Point)
    MoveSelected(Windows.Foundation.Point)

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

    public Rect MoveSelected(Windows.Foundation.Point translation)public Rect MoveSelected(Windows.Foundation.Point translation)Public Function MoveSelected(translation As Windows.Foundation.Point) As Rect

    Parameters

    • translation

      The destination screen coordinates for the upper-left corner of the bounding rectangle of the selected strokes.

    Returns

    Remarks

    The following can result from a call to MoveSelected(Windows.Foundation.Point):

    • Moving one or more strokes that make up part of a word results in the reprocessing of existing ink recognition results.
    • Moving all strokes that make up a word results in the recalculation of the BoundingRect of the InkRecognitionResult. Ink recognition is not reprocessed.
    • Moving one or more strokes results in the recalculation of the BoundingRect for each stroke.
    • Moving one or more strokes results in the recalculation of the BoundingRect of the InkStrokeContainer.
  • PasteFromClipboard(Windows.Foundation.Point)
    PasteFromClipboard(Windows.Foundation.Point)
    PasteFromClipboard(Windows.Foundation.Point)
    PasteFromClipboard(Windows.Foundation.Point)

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

    public Rect PasteFromClipboard(Windows.Foundation.Point position)public Rect PasteFromClipboard(Windows.Foundation.Point position)Public Function PasteFromClipboard(position As Windows.Foundation.Point) As Rect

    Parameters

    • position

      The screen coordinates for the upper-left corner of the bounding rectangle of the clipboard content.

    Returns

    Remarks

    The content of the clipboard must be in Ink Serialized Format (ISF) format.

    The InkStroke content from the clipboard is selected. Any existing selection is discarded.

  • SaveAsync(Windows.Storage.Streams.IOutputStream)
    SaveAsync(Windows.Storage.Streams.IOutputStream)
    SaveAsync(Windows.Storage.Streams.IOutputStream)
    SaveAsync(Windows.Storage.Streams.IOutputStream)

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

    public IAsyncOperationWithProgress<uint, uint> SaveAsync(Windows.Storage.Streams.IOutputStream outputStream)public IAsyncOperationWithProgress<uint, uint> SaveAsync(Windows.Storage.Streams.IOutputStream outputStream)Public Function SaveAsync(outputStream As Windows.Storage.Streams.IOutputStream) As IAsyncOperationWithProgress( Of uint, uint )

    Parameters

    Returns

    • The status of the asynchronous operation as the number of bytes sent. For more information, see WriteAsync method.

  • SaveAsync(Windows.Storage.Streams.IOutputStream,Windows.UI.Input.Inking.InkPersistenceFormat)
    SaveAsync(Windows.Storage.Streams.IOutputStream,Windows.UI.Input.Inking.InkPersistenceFormat)
    SaveAsync(Windows.Storage.Streams.IOutputStream,Windows.UI.Input.Inking.InkPersistenceFormat)
    SaveAsync(Windows.Storage.Streams.IOutputStream,Windows.UI.Input.Inking.InkPersistenceFormat)

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

    public IAsyncOperationWithProgress<uint, uint> SaveAsync(Windows.Storage.Streams.IOutputStream outputStream,Windows.UI.Input.Inking.InkPersistenceFormat inkPersistenceFormat)public IAsyncOperationWithProgress<uint, uint> SaveAsync(Windows.Storage.Streams.IOutputStream outputStream,Windows.UI.Input.Inking.InkPersistenceFormat inkPersistenceFormat)Public Function SaveAsync(outputStream As Windows.Storage.Streams.IOutputStream,inkPersistenceFormat As Windows.UI.Input.Inking.InkPersistenceFormat) As IAsyncOperationWithProgress( Of uint, uint )

    Parameters

    Returns

    • The status of the asynchronous operation as the number of bytes sent. For more information, see WriteAsync method.

  • SelectWithLine(Windows.Foundation.Point,Windows.Foundation.Point)
    SelectWithLine(Windows.Foundation.Point,Windows.Foundation.Point)
    SelectWithLine(Windows.Foundation.Point,Windows.Foundation.Point)
    SelectWithLine(Windows.Foundation.Point,Windows.Foundation.Point)

    Selects all strokes intersected by the new stroke.

    Note

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

    public Rect SelectWithLine(Windows.Foundation.Point from,Windows.Foundation.Point to)public Rect SelectWithLine(Windows.Foundation.Point from,Windows.Foundation.Point to)Public Function SelectWithLine(from As Windows.Foundation.Point,to As Windows.Foundation.Point) As Rect

    Parameters

    Returns

  • SelectWithPolyLine(Windows.Foundation.Collections.IIterable{Windows.Foundation.Point})
    SelectWithPolyLine(Windows.Foundation.Collections.IIterable{Windows.Foundation.Point})
    SelectWithPolyLine(Windows.Foundation.Collections.IIterable{Windows.Foundation.Point})
    SelectWithPolyLine(Windows.Foundation.Collections.IIterable{Windows.Foundation.Point})

    Selects all strokes contained entirely within the polyline.

    Note

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

    .

    public Rect SelectWithPolyLine(Windows.Foundation.Collections.IIterable{Windows.Foundation.Point} polyline)public Rect SelectWithPolyLine(Windows.Foundation.Collections.IIterable{Windows.Foundation.Point} polyline)Public Function SelectWithPolyLine(polyline As Windows.Foundation.Collections.IIterable{Windows.Foundation.Point}) As Rect

    Parameters

    • polyline

      The points of the polyline.

    Returns

  • UpdateRecognitionResults(Windows.Foundation.Collections.IVectorView{Windows.UI.Input.Inking.InkRecognitionResult})
    UpdateRecognitionResults(Windows.Foundation.Collections.IVectorView{Windows.UI.Input.Inking.InkRecognitionResult})
    UpdateRecognitionResults(Windows.Foundation.Collections.IVectorView{Windows.UI.Input.Inking.InkRecognitionResult})
    UpdateRecognitionResults(Windows.Foundation.Collections.IVectorView{Windows.UI.Input.Inking.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.

    public void UpdateRecognitionResults(Windows.Foundation.Collections.IVectorView{Windows.UI.Input.Inking.InkRecognitionResult} recognitionResults)public void UpdateRecognitionResults(Windows.Foundation.Collections.IVectorView{Windows.UI.Input.Inking.InkRecognitionResult} recognitionResults)Public Function UpdateRecognitionResults(recognitionResults As Windows.Foundation.Collections.IVectorView{Windows.UI.Input.Inking.InkRecognitionResult}) As void

    Parameters

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ActivatableAttribute
Windows.Foundation.Metadata.DualApiPartitionAttribute
Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.ThreadingAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute

Details

Assembly

Windows.UI.Input.Inking.dll