StrokeCollection.Erase Metodo
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Rimuove l'input penna all'interno dei limiti dell'area specificata.
Overload
| Nome | Descrizione |
|---|---|
| Erase(IEnumerable<Point>) |
Rimuove l'input penna all'interno dei limiti dell'area specificata. |
| Erase(Rect) |
Sostituisce tutti i tratti ritagliati dal rettangolo specificato con nuovi tratti che non immettono i limiti del rettangolo specificato. |
| Erase(IEnumerable<Point>, StylusShape) |
Sostituisce tutti i tratti ritagliati dall'area creata dall'oggetto specificato lungo il percorso specificato StylusShape con nuovi tratti che non vengono ritagliati dall'area. |
Erase(IEnumerable<Point>)
Rimuove l'input penna all'interno dei 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 oggetto StrokeCollection. 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 connette il primo e l'ultimo punto in lassoPoints per creare il lasso.
Può StrokeCollection contenere nuovi tratti dopo la chiamata al Erase metodo . 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 operazione di cancellazione.
Si applica a
Erase(Rect)
Sostituisce tutti i tratti ritagliati dal rettangolo specificato con nuovi tratti che non immettono i 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
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
Può StrokeCollection contenere nuovi tratti dopo la chiamata al Erase metodo . 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 interamente all'interno del rettangolo specificato vengono rimossi.
Il Erase metodo genera l'evento StrokesChanged per ogni Stroke operazione di cancellazione.
Si applica a
Erase(IEnumerable<Point>, StylusShape)
Sostituisce tutti i tratti ritagliati dall'area creata dall'oggetto specificato lungo il percorso specificato StylusShape con nuovi tratti 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>
Matrice di tipo Point che specifica il percorso da cancellare.
- eraserShape
- StylusShape
Oggetto StylusShape che specifica la forma della gomma.
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
Può StrokeCollection contenere nuovi tratti dopo la chiamata al Erase metodo . 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 operazione di cancellazione.