Compartilhar via


Ink.ExtractStrokes Method

Ink.ExtractStrokes Method

Extracts the specified Stroke objects from the Ink object and returns a new Ink object containing the extracted Stroke objects.

Definition

Visual Basic .NET Public Function ExtractStrokes( _
ByVal strokes As Strokes _
) As Ink
C# public Ink ExtractStrokes(
Strokes strokes
);
Managed C++ public: Ink* ExtractStrokes(
Strokes *strokes
);

Parameters

strokes Microsoft.Ink.Strokes. The Strokes collection to extract.

Return Value

Microsoft.Ink.Ink. Returns an Ink object that contains the extracted Strokes collection.

Exceptions

ArgumentException Leave Site: An invalid Stroke object was passed to this method. Verify that the Stroke object corresponds to this Ink object.

Remarks

The new Ink object retains the drawing attributes, properties, and coordinates of the original Ink object.

The default behavior for this method is to remove the Strokes collection from the original Ink object. To preserve the Strokes collection in the original Ink object and make a copy of the Ink, call either the ExtractStrokes(Strokes,ExtractFlags) or ExtractStrokes(Rectangle,ExtractFlags) overload of this method with the extractionFlags parameter set to CopyFromOriginal.

To extract a Strokes collection that is bound by a rectangle, call the ExtractStrokes(Rectangle) or ExtractStrokes(Rectangle,ExtractFlags) method.

Examples

[C#]

This C# example creates a new Ink object that contains a previously determined set of strokes, theDeletedStrokes, which are removed from the original Ink object in the InkCollector object, theInkCollector.

Ink theNewInk = theInkCollector.Ink.ExtractStrokes(theDeletedStrokes);

[Visual Basic .NET]

This Microsoft® Visual Basic® .NET example creates a new Ink object that contains a previously determined set of strokes, theDeletedStrokes, which are removed from the original Ink object in the InkCollector object, theInkCollector.

Dim theNewInk As Ink = _
    theInkCollector.Ink.ExtractStrokes(theDeletedStrokes)

See Also