IncrementalStrokeHitTester Klass

Definition

Dynamiskt träff testar en linje med en raderingssökväg.

public ref class IncrementalStrokeHitTester : System::Windows::Ink::IncrementalHitTester
public class IncrementalStrokeHitTester : System.Windows.Ink.IncrementalHitTester
type IncrementalStrokeHitTester = class
    inherit IncrementalHitTester
Public Class IncrementalStrokeHitTester
Inherits IncrementalHitTester
Arv
IncrementalStrokeHitTester

Exempel

I följande exempel visas hur du dynamiskt raderar en del av en Stroke. Information om hur du skapar en kontroll som gör det möjligt för en användare att radera pennanteckningar finns i How to: Erase Ink on a Custom Control (Så här gör du: Radera pennanteckningar på en anpassad kontroll).

// When the stylus intersects a stroke, erase that part of
// the stroke.  When the stylus dissects a stoke, the 
// Stroke.Erase method returns a StrokeCollection that contains
// the two new strokes.
void eraseTester_StrokeHit(object sender,
    StrokeHitEventArgs args)
{
    StrokeCollection eraseResult =
        args.GetPointEraseResults();
    StrokeCollection strokesToReplace = new StrokeCollection();
    strokesToReplace.Add(args.HitStroke);
   
    // Replace the old stroke with the new one.
    if (eraseResult.Count > 0)
    {
        presenter.Strokes.Replace(strokesToReplace, eraseResult);
    }
    else
    {
        presenter.Strokes.Remove(strokesToReplace);
    }
}
' When the stylus intersects a stroke, erase that part of
' the stroke.  When the stylus dissects a stoke, the 
' Stroke.Erase method returns a StrokeCollection that contains
' the two new strokes.
Private Sub eraseTester_StrokeHit(ByVal sender As Object, _
        ByVal args As StrokeHitEventArgs)

    Dim eraseResult As StrokeCollection = _
        args.GetPointEraseResults()
    Dim strokesToReplace As New StrokeCollection()
    strokesToReplace.Add(args.HitStroke)

    ' Replace the old stroke with the new one.
    If eraseResult.Count > 0 Then
        presenter.Strokes.Replace(strokesToReplace, eraseResult)
    Else
        presenter.Strokes.Remove(strokesToReplace)
    End If

End Sub

Kommentarer

Träffen IncrementalStrokeHitTester testar linjer genom att avgöra när en raderingsväg korsar den linjen. AddPoints Använd metoden i pennans händelser för att lägga till punkterna i IncrementalStrokeHitTester. När punkterna som läggs till i IncrementalStrokeHitTester intersektera en Stroke, IncrementalStrokeHitTester genererar StrokeHit händelsen.

Egenskaper

Name Description
IsValid

Hämtar om IncrementalHitTester är träfftestning.

(Ärvd från IncrementalHitTester)

Metoder

Name Description
AddPoint(Point)

Lägger till en Point i IncrementalHitTester.

(Ärvd från IncrementalHitTester)
AddPoints(IEnumerable<Point>)

Lägger till punkter i IncrementalHitTester.

(Ärvd från IncrementalHitTester)
AddPoints(StylusPointCollection)

Lägger till de angivna StylusPoint objekten i IncrementalHitTester.

(Ärvd från IncrementalHitTester)
AddPointsCore(IEnumerable<Point>)

Lägger till punkter i IncrementalHitTester.

EndHitTesting()

Frigör resurser som används av IncrementalHitTester.

(Ärvd från IncrementalHitTester)
Equals(Object)

Avgör om det angivna objektet är lika med det aktuella objektet.

(Ärvd från Object)
GetHashCode()

Fungerar som standard-hash-funktion.

(Ärvd från Object)
GetType()

Hämtar den aktuella instansen Type .

(Ärvd från Object)
MemberwiseClone()

Skapar en ytlig kopia av den aktuella Object.

(Ärvd från Object)
OnStrokeHit(StrokeHitEventArgs)

Genererar händelsen StrokeHit .

ToString()

Returnerar en sträng som representerar det aktuella objektet.

(Ärvd från Object)

Händelser

Name Description
StrokeHit

Inträffar när den IncrementalStrokeHitTester korsar en pennanteckning Stroke.

Gäller för