次の方法で共有


Strokes.Remove メソッド (Strokes)

Strokes コレクションから Strokes コレクションを削除します。

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

構文

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

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

パラメータ

解説

Strokes コレクションは、実際のデータではなくインク データへの参照のセットです。Remove メソッドは、実際のインク データではなくインク データ参照を削除します。実際のインク データを削除するには、Ink.DeleteStrokes メソッドを呼び出します。

Remove メソッドを呼び出した後に、コレクション内のオブジェクトが並べ替えられます。Microsoft Visual Basic.NET の例では、Strokes.Remove(Strokes.Item(0)) を呼び出した後に、Strokes.Item(1) が Strokes.Item(0)、Strokes.Item(2) が Strokes.Item(1) などになることを示します。

この C# の例では、Stroke の最初のポイントが Stroke の最後のポイントの左側にない場合、大きい方の Strokes コレクション theLeftToRightStokes から Strokes コレクション strokesToRemove を削除します。Ink オブジェクトの元のデータは影響を受けません。

//...
Strokes strokesToRemove = theLeftToRightStrokes.Ink.CreateStrokes();
foreach (Stroke testStroke in theLeftToRightStrokes)
{
    Point ptStart = testStroke.GetPoint(0);
    Point ptEnd = testStroke.GetPoint(testStroke.PacketCount - 1);
    if (ptStart.X > ptEnd.X)
        strokesToRemove.Add(testStroke);
}
theLeftToRightStrokes.Remove(strokesToRemove);

この Visual Basic .NET の例では、Stroke の最初のポイントが Stroke の最後のポイントの左側にない場合、大きい方の Strokes コレクション theLeftToRightStokes から Strokes コレクション strokesToRemove を削除します。Ink オブジェクトの元のデータは影響を受けません。

'...
Dim testStroke As Stroke
Dim strokesToRemove As Strokes = theLeftToRightStrokes.Ink.CreateStrokes()
For Each testStroke In theLeftToRightStrokes
    Dim ptStart As Point = testStroke.GetPoint(0)
    Dim ptEnd As Point = testStroke.GetPoint(testStroke.PacketCount - 1)
    If ptStart.X > ptEnd.X Then
       strokesToRemove.Add(testStroke)
    End If
Next
theLeftToRightStrokes.Remove(strokesToRemove)

プラットフォーム

Windows Vista

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

バージョン情報

.NET Framework

サポート対象 : 3.0

参照

参照

Strokes クラス

Strokes メンバ

Remove オーバーロード

Microsoft.Ink 名前空間

Strokes.RemoveAt

Stroke

Strokes