StrokeCollection.GetIncrementalStrokeHitTester(StylusShape) Método

Definição

Cria um IncrementalStrokeHitTester teste de acerto com StrokeCollection um caminho de apagamento.

public:
 System::Windows::Ink::IncrementalStrokeHitTester ^ GetIncrementalStrokeHitTester(System::Windows::Ink::StylusShape ^ eraserShape);
public System.Windows.Ink.IncrementalStrokeHitTester GetIncrementalStrokeHitTester(System.Windows.Ink.StylusShape eraserShape);
member this.GetIncrementalStrokeHitTester : System.Windows.Ink.StylusShape -> System.Windows.Ink.IncrementalStrokeHitTester
Public Function GetIncrementalStrokeHitTester (eraserShape As StylusShape) As IncrementalStrokeHitTester

Parâmetros

eraserShape
StylusShape

A StylusShape que especifica a ponta da caneta.

Devoluções

E IncrementalStrokeHitTester esse hit testa o StrokeCollection.

Exemplos

O exemplo seguinte demonstra como obter um IncrementalStrokeHitTester que pode ser usado para apagar parte de um Stroke. Para criar um controlo que permita ao utilizador apagar tinta, veja Como: Apagar Tinta num Controlo Personalizado.

// Prepare to collect stylus packets. Get the 
// IncrementalHitTester from the InkPresenter's 
// StrokeCollection and subscribe to its StrokeHitChanged event.
protected override void OnStylusDown(StylusDownEventArgs e)
{
    base.OnStylusDown(e);

    EllipseStylusShape eraserTip = new EllipseStylusShape(3, 3, 0);
    eraseTester = 
        presenter.Strokes.GetIncrementalStrokeHitTester(eraserTip);
    eraseTester.StrokeHit += new StrokeHitEventHandler(eraseTester_StrokeHit);
    eraseTester.AddPoints(e.GetStylusPoints(this));
}
' Prepare to collect stylus packets. Get the 
' IncrementalHitTester from the InkPresenter's 
' StrokeCollection and subscribe to its StrokeHitChanged event.
Protected Overrides Sub OnStylusDown(ByVal e As StylusDownEventArgs)

    MyBase.OnStylusDown(e)

    Dim eraserTip As New EllipseStylusShape(3, 3, 0)
    eraseTester = presenter.Strokes.GetIncrementalStrokeHitTester(eraserTip)
    AddHandler eraseTester.StrokeHit, _
        AddressOf eraseTester_StrokeHit
    eraseTester.AddPoints(e.GetStylusPoints(Me))

End Sub

Observações

O GetIncrementalStrokeHitTester método retorna um IncrementalStrokeHitTester que considera a Stroke como "atingido" quando o caminho do borracho o intersecta. Isto é útil para implementar funcionalidades, como a capacidade de apagar parte de um Stroke. O usa e InkCanvas quando a IncrementalStrokeHitTester propriedade é definida para EditingMode.EraseByPoint

Aplica-se a