共用方式為


Ink.ExtractStrokes Method

Ink.ExtractStrokes Method

Extracts all of the Stroke objects from the Ink object and returns a new Ink object containing the extracted Strokes collection.

Definition

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

Return Value

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

Exceptions

ObjectDisposedException Leave Site: The Stroke object is disposed.

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 an Ink object that contains the Strokes collection from the InkCollector, theInkCollector. The Stroke objects are removed from theInkCollector.

Ink theNewInk = theInkCollector.Ink.ExtractStrokes();

[Visual Basic .NET]

This Microsoft® Visual Basic® .NET example creates an Ink object that contains the Strokes collection from the InkCollector, theInkCollector. The Stroke objects are removed from theInkCollector.

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

See Also