Stroke.GetEraseResult Method (Rect)

 
System_CAPS_noteNote

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

Returns segments of the current Stroke that are outside the specified rectangle.

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

public StrokeCollection GetEraseResult(
	Rect bounds
)

Parameters

bounds
Type: System.Windows.Rect

A Rect that specifies the area to erase.

Return Value

Type: System.Windows.Ink.StrokeCollection

A StrokeCollection that contains the segments of the current Stroke that are outside the bounds of the specified Rect.

The GetEraseResult method returns a StrokeCollection that contains strokes that represent the segments of the Stroke that are outside of bounds. GetEraseResult does not change the original Stroke.

The following example removes the ink that is within the specified bounds.

Rect myRect = new Rect(100, 100, 100, 100);

StrokeCollection eraseResults = aStroke.GetEraseResult(myRect);

// inkCanvas1 is the InkCanvas on which we update the strokes
inkCanvas1.Strokes.Remove(aStroke);
inkCanvas1.Strokes.Add(eraseResults);

.NET Framework
Available since 3.0
Return to top
Show: