Stroke.GetClipResult Method (IEnumerable<Point>)

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
)

Parameters

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
inkCanvas1.Strokes.Remove(aStroke);
inkCanvas1.Strokes.Add(clipResults);

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft