Share via


Ink.ExtractStrokes Method (Rectangle, ExtractFlags)

Extracts the all the Stroke objects within the bounds of a specified rectangle from the Ink object by using either cut or copy, as specified, and returns a new Ink object containing the extracted Strokes collection.

Namespace: Microsoft.Ink
Assembly: Microsoft.Ink (in microsoft.ink.dll)

Syntax

'Declaration
Public Function ExtractStrokes ( _
    extractionRectangle As Rectangle, _
    extractionFlags As ExtractFlags _
) As Ink
'Usage
Dim instance As Ink
Dim extractionRectangle As Rectangle
Dim extractionFlags As ExtractFlags
Dim returnValue As Ink

returnValue = instance.ExtractStrokes(extractionRectangle, extractionFlags)
public Ink ExtractStrokes (
    Rectangle extractionRectangle,
    ExtractFlags extractionFlags
)
public:
Ink^ ExtractStrokes (
    Rectangle extractionRectangle, 
    ExtractFlags extractionFlags
)
public Ink ExtractStrokes (
    Rectangle extractionRectangle, 
    ExtractFlags extractionFlags
)
public function ExtractStrokes (
    extractionRectangle : Rectangle, 
    extractionFlags : ExtractFlags
) : Ink
Not applicable.

Parameters

  • extractionRectangle
    The Rectangle that delimits the ink to extract from the Ink object.
  • extractionFlags
    One of the ExtractFlags values that specifies whether the ink is cut or copied into the new Ink object.

Return Value

Returns an Ink object that contains the extracted Strokes collection.

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 or ExtractStrokes overload of this method with the extractionFlags parameter set to the CopyFromOriginal value from the ExtractFlags enumeration.

Example

This C# example creates a new Ink object, theNewInk. The new Ink object contains a copy of the Strokes collection from the Ink object that is in an InkCollector object, theInkCollector, and that is bounded by the Rectangle, rectSelection. The Strokes collection is preserved in the original Ink object, because the extractionFlags parameter is set to the CopyFromOriginal value from the ExtractFlags enumeration.

Ink theNewInk = theInkCollector.Ink.ExtractStrokes(rectSelection,
    ExtractFlags.CopyFromOriginal);

This Microsoft Visual Basic.NET example creates a new Ink object, theNewInk. The new Ink object contains a copy of the Strokes collection from the Ink object that is in an InkCollector object, theInkCollector, and that is bounded by the Rectangle, rectSelection. The Strokes collection is preserved in the original Ink object, because the extractionFlags parameter is set to the CopyFromOriginal value from the ExtractFlags enumeration.

Dim theNewInk As Ink = theInkCollector.Ink.ExtractStrokes(rectSelection, _
    ExtractFlags.CopyFromOriginal)

Platforms

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

Ink Class
Ink Members
Microsoft.Ink Namespace
Strokes
ExtractFlags