Stroke.GetEraseResult Method (IEnumerable<Point>)

 

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

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

public StrokeCollection GetEraseResult(
	IEnumerable<Point> lassoPoints
)

Parameters

lassoPoints
Type: System.Collections.Generic.IEnumerable<Point>

An array of type Point 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 specified bounds.

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

The GetClipResult method connects the first and last points in lassoPoints to create the lasso.

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

Point[] myPoints = new Point[] {
    new Point(100, 100),
    new Point(200, 100),
    new Point(200, 200),
    new Point(100, 200)};

StrokeCollection eraseResults = aStroke.GetEraseResult(myPoints);

// 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: