Stroke.GetEraseResult 方法

定义

在清除部分 Stroke 后,返回当前 Stroke 的线段。

重载

GetEraseResult(IEnumerable<Point>)

返回当前 Stroke 的位于指定边界外的线段。

GetEraseResult(Rect)

返回位于当前 Stroke 的指定矩形外的线段。

GetEraseResult(IEnumerable<Point>, StylusShape)

在指定的路径使用指定的 Stroke 分割当前的 StylusShape 后,返回其线段。

GetEraseResult(IEnumerable<Point>)

返回当前 Stroke 的位于指定边界外的线段。

public:
 System::Windows::Ink::StrokeCollection ^ GetEraseResult(System::Collections::Generic::IEnumerable<System::Windows::Point> ^ lassoPoints);
public System.Windows.Ink.StrokeCollection GetEraseResult (System.Collections.Generic.IEnumerable<System.Windows.Point> lassoPoints);
member this.GetEraseResult : seq<System.Windows.Point> -> System.Windows.Ink.StrokeCollection
Public Function GetEraseResult (lassoPoints As IEnumerable(Of Point)) As StrokeCollection

参数

lassoPoints
IEnumerable<Point>

Point 类型的数组,用于指定要清除的区域。

返回

StrokeCollection,其中包含当前 Stroke 的位于指定边界外的线段。

示例

以下示例删除指定边界内的墨迹。

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);
Dim myPoints() As System.Windows.Point = _
              {New System.Windows.Point(100, 100), _
               New System.Windows.Point(200, 100), _
               New System.Windows.Point(200, 200), _
               New System.Windows.Point(100, 200)}

Dim eraseResults As StrokeCollection = aStroke.GetEraseResult(myPoints)

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

注解

方法GetEraseResult返回一个 ,StrokeCollection其中包含表示 外部的 段的StrokelassoPoints笔划。 GetEraseResult 不会更改原始 Stroke

方法 GetClipResult 连接 中的 lassoPoints 第一个和最后一个点,以创建套索。

适用于

GetEraseResult(Rect)

返回位于当前 Stroke 的指定矩形外的线段。

public:
 System::Windows::Ink::StrokeCollection ^ GetEraseResult(System::Windows::Rect bounds);
public System.Windows.Ink.StrokeCollection GetEraseResult (System.Windows.Rect bounds);
member this.GetEraseResult : System.Windows.Rect -> System.Windows.Ink.StrokeCollection
Public Function GetEraseResult (bounds As Rect) As StrokeCollection

参数

bounds
Rect

一个 Rect,用于指定要清除的区域。

返回

StrokeCollection,其中包含当前 Stroke 的位于指定 Rect 边界外的线段。

示例

以下示例删除指定边界内的墨迹。

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);
Dim myRect As New Rect(100, 100, 100, 100)

Dim eraseResults As StrokeCollection = aStroke.GetEraseResult(myRect)

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

注解

方法GetEraseResult返回一个 ,StrokeCollection其中包含表示 外部的 段的Strokebounds笔划。 GetEraseResult 不会更改原始 Stroke

适用于

GetEraseResult(IEnumerable<Point>, StylusShape)

在指定的路径使用指定的 Stroke 分割当前的 StylusShape 后,返回其线段。

public:
 System::Windows::Ink::StrokeCollection ^ GetEraseResult(System::Collections::Generic::IEnumerable<System::Windows::Point> ^ eraserPath, System::Windows::Ink::StylusShape ^ eraserShape);
public System.Windows.Ink.StrokeCollection GetEraseResult (System.Collections.Generic.IEnumerable<System.Windows.Point> eraserPath, System.Windows.Ink.StylusShape eraserShape);
member this.GetEraseResult : seq<System.Windows.Point> * System.Windows.Ink.StylusShape -> System.Windows.Ink.StrokeCollection
Public Function GetEraseResult (eraserPath As IEnumerable(Of Point), eraserShape As StylusShape) As StrokeCollection

参数

eraserPath
IEnumerable<Point>

Point 类型的数组,指定用于分割 Stroke 的路径。

eraserShape
StylusShape

StylusShape,用于指定橡皮擦的形状。

返回

StrokeCollection,包含当前 Stroke 被指定路径分割后的线段的副本。

示例

以下示例演示如何擦除与指定路径相交的墨迹。

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

EllipseStylusShape myStylus = new EllipseStylusShape(5.0, 5.0, 0.0);

StrokeCollection eraseResults = aStroke.GetEraseResult(myPoints, myStylus);

// inkCanvas1 is the InkCanvas on which we update the strokes
inkCanvas1.Strokes.Remove(aStroke);
inkCanvas1.Strokes.Add(eraseResults);
Dim myPoints() As System.Windows.Point = _
                      {New System.Windows.Point(100, 100), _
                       New System.Windows.Point(200, 100), _
                       New System.Windows.Point(200, 200), _
                       New System.Windows.Point(100, 200)}

Dim myStylus As New EllipseStylusShape(5.0, 5.0, 0.0)

Dim eraseResults As StrokeCollection = aStroke.GetEraseResult(myPoints, myStylus)

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

注解

方法 GetEraseResult 使用 eraserShape 来命中测试笔划, eraserPath 并返回一个 StrokeCollection 表示已剖析段的 。 GetEraseResult 不会更改原始 Stroke

适用于