StrokeCollection.Erase Metodo

Definizione

Rimuove l'input penna che è interno ai limiti dell'area specificata.

Overload

Erase(IEnumerable<Point>)

Rimuove l'input penna che è interno ai limiti dell'area specificata.

Erase(Rect)

Sostituisce tutti i tratti ritagliati dal rettangolo specificato con tratti nuovi che non vengono inseriti all'interno dei limiti del rettangolo specificato.

Erase(IEnumerable<Point>, StylusShape)

Sostituisce tutti i tratti ritagliati dall'area creata dall'oggetto StylusShape specificato lungo il tracciato specificato con nuovi oggetti Strokes e che non vengono ritagliati dall'area.

Erase(IEnumerable<Point>)

Rimuove l'input penna che è interno ai limiti dell'area specificata.

public:
 void Erase(System::Collections::Generic::IEnumerable<System::Windows::Point> ^ lassoPoints);
public void Erase (System.Collections.Generic.IEnumerable<System.Windows.Point> lassoPoints);
member this.Erase : seq<System.Windows.Point> -> unit
Public Sub Erase (lassoPoints As IEnumerable(Of Point))

Parametri

lassoPoints
IEnumerable<Point>

Matrice di tipo Point che specifica l'area da cancellare.

Esempio

Nell'esempio seguente viene illustrato come cancellare i tratti in un StrokeCollectionoggetto . In questo esempio si presuppone che sia presente un InkPresenter oggetto denominato presenter.

// Erase the selected strokes.
public void EraseStrokes(Stroke lasso)
{
    Point[] strokePoints = (Point[])lasso.StylusPoints;
    presenter.Strokes.Erase(strokePoints);
}
' Erase the selected strokes.
Public Overloads Sub EraseStrokes(ByVal lasso As Stroke)

    If lasso Is Nothing Then
        Return
    End If

    Dim strokePoints() As Point = CType(lasso.StylusPoints, Point())

    presenter.Strokes.Erase(strokePoints)

End Sub

Commenti

Il Erase metodo si connette il primo e ultimo punto nella lassoPoints creare lazo.

Potrebbe StrokeCollection contenere nuovi tratti dopo che il Erase metodo viene chiamato. Ad esempio, se l'area specificata si trova al centro di un Strokeoggetto , il metodo di cancellazione rimuove e Stroke crea due nuovi tratti.

Il Erase metodo genera l'evento StrokesChanged per ogni Stroke oggetto che cancella.

Si applica a

Erase(Rect)

Sostituisce tutti i tratti ritagliati dal rettangolo specificato con tratti nuovi che non vengono inseriti all'interno dei limiti del rettangolo specificato.

public:
 void Erase(System::Windows::Rect bounds);
public void Erase (System.Windows.Rect bounds);
member this.Erase : System.Windows.Rect -> unit
Public Sub Erase (bounds As Rect)

Parametri

bounds
Rect

Oggetto Rect che specifica l'area da cancellare.

Esempio

Nell'esempio seguente viene illustrato come cancellare l'input penna all'interno di Rect. In questo esempio si presuppone che sia presente un InkPresenter oggetto denominato presenter.

Rect rect = new Rect(100, 100, 200, 200);
presenter.Strokes.Erase(rect);
Dim rect As Rect = New Rect(100, 100, 200, 200)
presenter.Strokes.Erase(rect)

Commenti

Potrebbe StrokeCollection contenere nuovi tratti dopo che il Erase metodo viene chiamato. Ad esempio, se l'area specificata si trova al centro di un Strokeoggetto , il metodo di cancellazione rimuove e Stroke crea due nuovi tratti. Tutti i tratti all'interno del rettangolo specificato vengono rimossi.

Il Erase metodo genera l'evento StrokesChanged per ogni Stroke oggetto che cancella.

Si applica a

Erase(IEnumerable<Point>, StylusShape)

Sostituisce tutti i tratti ritagliati dall'area creata dall'oggetto StylusShape specificato lungo il tracciato specificato con nuovi oggetti Strokes e che non vengono ritagliati dall'area.

public:
 void Erase(System::Collections::Generic::IEnumerable<System::Windows::Point> ^ eraserPath, System::Windows::Ink::StylusShape ^ eraserShape);
public void Erase (System.Collections.Generic.IEnumerable<System.Windows.Point> eraserPath, System.Windows.Ink.StylusShape eraserShape);
member this.Erase : seq<System.Windows.Point> * System.Windows.Ink.StylusShape -> unit
Public Sub Erase (eraserPath As IEnumerable(Of Point), eraserShape As StylusShape)

Parametri

eraserPath
IEnumerable<Point>

La matrice di tipo Point che specifica il tracciato da cancellare.

eraserShape
StylusShape

Oggetto StylusShape che specifica la forma della gomma da cancellare.

Esempio

Nell'esempio seguente viene illustrato come cancellare l'input penna lungo un percorso specifico. In questo esempio si presuppone che sia presente un InkPresenter oggetto denominato presenter.

// Erase the ink that intersects the lasso.
public void ErasePath(Stroke lasso)
{
    EllipseStylusShape eraserTip = new EllipseStylusShape(5, 5);
    Point[] strokePoints = (Point[])lasso.StylusPoints;

    presenter.Strokes.Erase(strokePoints, eraserTip);
}
' Erase the ink that intersects the lasso.
Public Overloads Sub ErasePath(ByVal lasso As Stroke)

    If lasso Is Nothing Then
        Return
    End If

    Dim eraserTip As New EllipseStylusShape(5, 5, 0)
    Dim strokePoints() As Point = CType(lasso.StylusPoints, Point())

    presenter.Strokes.Erase(strokePoints, eraserTip)

End Sub

Commenti

Potrebbe StrokeCollection contenere nuovi tratti dopo che il Erase metodo viene chiamato. Ad esempio, se path interseca il centro di un Strokeoggetto , il metodo di cancellazione rimuove e Stroke crea due nuovi tratti.

Il Erase metodo genera l'evento StrokesChanged per ogni Stroke oggetto che cancella.

Si applica a