次の方法で共有


Strokes.Add メソッド (Strokes)

Strokes コレクションを Strokes コレクションに追加します。

名前空間 :  Microsoft.Ink
アセンブリ :  Microsoft.Ink (Microsoft.Ink.dll 内)

構文

'宣言
Public Sub Add ( _
    strokes As Strokes _
)
'使用
Dim instance As Strokes
Dim strokes As Strokes

instance.Add(strokes)
public void Add(
    Strokes strokes
)
public:
void Add(
    Strokes^ strokes
)
public void Add(
    Strokes strokes
)
public function Add(
    strokes : Strokes
)

パラメータ

解説

Stroke オブジェクトは Ink オブジェクト内に存在している必要があり、別の Ink オブジェクトに属すことはできません。さらに、このメソッドは Ink オブジェクトのコピーや変更は行わず、単にこの StrokeStrokes コレクションに追加するだけです。

この例では、新しく作成された Strokes コレクションに Stroke オブジェクトが追加されます。次に、このコレクションがさらに別の Strokes コレクションに追加されます。この例のメソッドに渡される Ink オブジェクトは、新しい Strokes コレクションと、新しい Stroke オブジェクトを作成するために使用されます。CreateStroke メソッドを呼び出して新しい Stroke オブジェクトを作成すると、新しく作成した StrokeInk オブジェクトのメインの Strokes() コレクションに自動的に追加されます。さらに、この例で示すように、新しく作成した Stroke オブジェクトを別の Strokes コレクションに追加することもできます。

Private Sub AddStrokes(ByVal mInk As Ink)
    ' create a new Strokes collection
    Dim newStrokes1 As Strokes = mInk.CreateStrokes()
    ' create a new Stroke
    Dim points As Point() = {New Point(500, 500), New Point(500, 2500)}
    Dim newStroke As Stroke = mInk.CreateStroke(points)
    ' add the new Stroke to the Strokes collection
    newStrokes1.Add(newStroke)
    ' create another Strokes collection
    Dim newStrokes2 As Strokes = mInk.CreateStrokes()
    ' add the first Strokes collection to the second Strokes collection
    newStrokes2.Add(newStrokes1)
End Sub
private void AddStrokes(Ink mInk)
{ 
    // create a new Strokes collection
    Strokes newStrokes1 = mInk.CreateStrokes();
    // create a new Stroke
    Point[] points = { new Point(500, 500), new Point(500, 2500) };
    Stroke newStroke = mInk.CreateStroke(points);
    // add the new Stroke to the Strokes collection
    newStrokes1.Add(newStroke);
    // create another Strokes collection
    Strokes newStrokes2 = mInk.CreateStrokes();
    // add the first Strokes collection to the second Strokes collection
    newStrokes2.Add(newStrokes1);
}

プラットフォーム

Windows Vista

.NET Framework および .NET Compact Framework では、各プラットフォームのすべてのバージョンはサポートしていません。サポートされているバージョンについては、「.NET Framework システム要件」を参照してください。

バージョン情報

.NET Framework

サポート対象 : 3.0

参照

参照

Strokes クラス

Strokes メンバ

Add オーバーロード

Microsoft.Ink 名前空間

Stroke

Strokes