共用方式為


Ink.CreateStrokes 方法 (array<Int32[])

依據 Stroke 物件的指定 Id 屬性,建立 Strokes 集合。

命名空間:  Microsoft.Ink
組件:  Microsoft.Ink (在 Microsoft.Ink.dll 中)

語法

'宣告
Public Function CreateStrokes ( _
    ids As Integer() _
) As Strokes
'用途
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 Strokes CreateStrokes(
    int[] ids
)
public function CreateStrokes(
    ids : int[]
) : Strokes

參數

  • ids
    型別:array<System.Int32[]
    指定 Id 屬性的陣列,屬於 Ink 物件中存在的 Stroke 物件。具有這些 Id 值的 Stroke 物件,會加入到新 Strokes 集合中。預設值是 nullNull 參照 (即 Visual Basic 中的 Nothing) (在 Microsoft Visual Basic .NET 中為 Nothing)。

傳回值

型別:Microsoft.Ink.Strokes
傳回新的 Strokes 集合。

備註

如果 ids 參數是 nullNull 參照 (即 Visual Basic 中的 Nothing) (在 Visual Basic .NET 中為 Nothing) 或空白陣列,則會建立空白的 Strokes 集合。

範例

在這個範例中,會從 Id 屬性陣列建立新的 Strokes 集合。Id 屬性的取得,是藉由檢查目前與 InkOverlay 物件相關聯的每個 Stroke 物件而達成。

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

平台

Windows Vista

.NET Framework 和 .NET Compact Framework 並不支援各種平台的所有版本。如需支援平台版本的相關資訊,請參閱 .NET Framework 系統需求

版本資訊

.NET Framework

支援版本:3.0

請參閱

參考

Ink 類別

Ink 成員

CreateStrokes 多載

Microsoft.Ink 命名空間

Strokes

Ink.CreateStroke

Ink.DeleteStroke

Ink.DeleteStrokes