Share via


Ink.Strokes Property

Gets a copy of the Strokes collection contained in the Ink object.

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

Syntax

'Declaration
Public ReadOnly Property Strokes As Strokes
'Usage
Dim instance As Ink 
Dim value As Strokes 

value = instance.Strokes
public Strokes Strokes { get; }
public:
property Strokes^ Strokes {
    Strokes^ get ();
}
public function get Strokes () : Strokes

Property Value

Type: Microsoft.Ink.Strokes
A copy of the Strokes collection contained in the Ink object.

Remarks

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;
}

Examples

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

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

See Also

Reference

Ink Class

Ink Members

Microsoft.Ink Namespace

Strokes

Stroke

Ink.CustomStrokes