Ink.Strokes Property
Assembly: Microsoft.Ink (in Microsoft.Ink.dll)
Note: |
|---|
The Strokes property for the Ink object does not return the actual collection that the Ink object works with, but instead returns a copy. For example, this means that adding or removing strokes to this collection does not affect the Ink object's strokes; to add or remove strokes, use Ink methods such as AddStrokesAtRectangle, DeleteStroke, and DeleteStrokes. However, each stroke in the collection is a reference to the original Stroke object. |
Instances of Strokes collections which are obtained from an Ink object using this method are not garbage collected. In order to avoid a memory leak, any time that you are working with one of these collections, make use of the using statement as shown below.
using (Strokes strokes = myInk.Strokes)
{
int i = strokes.Count;
}
This C# example gets the number of strokes that have been collected by an InkCollector object, theInkCollector.
using (Strokes strokes = theInkCollector.Ink.Strokes) { int numberOfStrokes = strokes.Count; }
This Microsoft Visual Basic.NET example gets the number of strokes that have been collected by an InkCollector object, theInkCollector.
Dim numberOfStrokes As Integer Using strokes As Microsoft.Ink.Strokes = theInkCollector.Ink.Strokes numberOfStrokes = strokes.Count() End Using
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.
Note: