Ink.ExtractStrokes Method (Strokes)
Extracts the specified Stroke objects from the Ink object and returns a new Ink object containing the extracted Stroke objects.
Namespace: Microsoft.Ink
Assembly: Microsoft.Ink (in Microsoft.Ink.dll)
Syntax
'Declaration
Public Function ExtractStrokes ( _
strokes As Strokes _
) As Ink
'Usage
Dim instance As Ink
Dim strokes As Strokes
Dim returnValue As Ink
returnValue = instance.ExtractStrokes(strokes)
public Ink ExtractStrokes(
Strokes strokes
)
public:
Ink^ ExtractStrokes(
Strokes^ strokes
)
public function ExtractStrokes(
strokes : Strokes
) : Ink
Parameters
strokes
Type: Microsoft.Ink.StrokesThe Strokes collection to extract.
Return Value
Type: Microsoft.Ink.Ink
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..
Examples
In this example, a new Ink object is created that contains the first two Stroke objects of an InkOverlay object. The extracted Stroke objects are removed from the original Ink object associated with the InkOverlay object.
' Access to the Strokes property returns a copy of the Strokes object.
' This copy must be implicitly (via using statement) or explicitly
' disposed of in order to asub a memory leak.
Using allStrokes As Strokes = mInkOverlay.Ink.Strokes
If (allStrokes.Count > 2) Then
Dim temp As Strokes = allStrokes.Ink.CreateStrokes()
temp.Add(allStrokes(0))
temp.Add(allStrokes(1))
Dim newInk As Ink = allStrokes.Ink.ExtractStrokes(temp)
End If
End Using
// Access to the Strokes property returns a copy of the Strokes object.
// This copy must be implicitly (via using statement) or explicitly
// disposed of in order to avoid a memory leak.
using (Strokes allStrokes = mInkOverlay.Ink.Strokes)
{
if (allStrokes.Count > 2)
{
Strokes temp = allStrokes.Ink.CreateStrokes();
temp.Add(allStrokes[0]);
temp.Add(allStrokes[1]);
Ink newInk = allStrokes.Ink.ExtractStrokes(temp);
}
}
Platforms
Windows 7, Windows Vista, Windows Server 2008 R2, Windows Server 2008
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Version Information
.NET Framework
Supported in: 3.0