Compartir a través de


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 ();
}
/** @property */
public Strokes get_Strokes ()
public function get Strokes () : Strokes
Not applicable.

Property Value

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

Example

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 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
Stroke
Ink.CustomStrokes