IncrementalStrokeHitTester.StrokeHit Event


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Occurs when the IncrementalStrokeHitTester intersects an ink Stroke.

Namespace:   System.Windows.Ink
Assembly:  PresentationCore (in PresentationCore.dll)

public event StrokeHitEventHandler StrokeHit

The following example demonstrates how to dynamically erase a portion of a Stroke. To create a control that enables a user to erase ink, see How to: Erase Ink on a Custom Control.

// 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 =
    StrokeCollection strokesToReplace = new StrokeCollection();

    // Replace the old stroke with the new one.
    if (eraseResult.Count > 0)
        presenter.Strokes.Replace(strokesToReplace, eraseResult);


.NET Framework
Available since 3.0
Return to top