次の方法で共有


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[]
    Ink オブジェクト内にある Stroke オブジェクトの指定した Id プロパティの配列。これらの 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