Stroke.GetClipResult Method (IEnumerable<Point>)


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

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

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

public StrokeCollection GetClipResult(
	IEnumerable<Point> lassoPoints


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

The points that specify the line which defines where to clip.

Return Value

Type: System.Windows.Ink.StrokeCollection

A StrokeCollection that contains copies of the segments of the current Stroke that are within the specified bounds.

The GetClipResult method returns a StrokeCollection that contains strokes that represent the segments of the Stroke that is within lassoPoints. GetClipResult 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 outside of the specified bounds.

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

StrokeCollection clipResults = aStroke.GetClipResult(myPoints);

// inkCanvas1 is the InkCanvas on which we update the strokes

.NET Framework
Available since 3.0
Return to top