Share via


Ink.CreateStrokes Method (array<Int32[])

Creates a Strokes collection based on specified Id properties of Stroke objects.

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

Syntax

'Declaration
Public Function CreateStrokes ( _
    ids As Integer() _
) As Strokes
'Usage
Dim instance As Ink 
Dim ids As Integer()
Dim returnValue As Strokes 

returnValue = instance.CreateStrokes(ids)
public Strokes CreateStrokes(
    int[] ids
)
public:
Strokes^ CreateStrokes(
    array<int>^ ids
)
public function CreateStrokes(
    ids : int[]
) : Strokes

Parameters

  • ids
    Type: array<System.Int32[]

    An array of specified Id properties for Stroke objects that exist in the Ink object. The Stroke objects with these Id values are added to a new Strokes collection. The default value is nulla null reference (Nothing in Visual Basic) (Nothing in Microsoft Visual Basic.NET).

Return Value

Type: Microsoft.Ink.Strokes
Returns a new Strokes collection.

Remarks

If the ids parameter is nulla null reference (Nothing in Visual Basic) (Nothing in Visual Basic .NET) or an empty array, an empty Strokes collection is created.

Examples

In this example, a new Strokes collection is created from an array of Id properties. The Id properties are obtained by examining each Stroke object currently associated with an InkOverlay object.

' Access to the Ink.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 currentStrokes As Strokes = mInkOverlay.Ink.Strokes
    ' Declare an array of integers 
    Dim theStrokeIDs(currentStrokes.Count - 1) As Integer 
    ' Copy stroke IDs into the array 
    For k As Integer = 0 To currentStrokes.Count - 1
        theStrokeIDs(k) = currentStrokes(k).Id
    Next 
    ' Create a new collection using the array of stroke IDs 
    Dim newStokes As Strokes = mInkOverlay.Ink.CreateStrokes(theStrokeIDs)
End Using
// Access to the Ink.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 currentStrokes = mInkOverlay.Ink.Strokes)
{
    // Declare an array of integers 
    int[] theStrokeIDs = new int[currentStrokes.Count];

    // Copy stroke IDs into the array 
    for (int k = 0; k < currentStrokes.Count; k++)
    {
        theStrokeIDs[k] = currentStrokes[k].Id;
    }
    // Create a new collection using the array of stroke IDs
    Strokes newStrokes = mInkOverlay.Ink.CreateStrokes(theStrokeIDs);
}

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

CreateStrokes Overload

Microsoft.Ink Namespace

Strokes

Ink.CreateStroke

Ink.DeleteStroke

Ink.DeleteStrokes