共用方式為


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

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)

備註

方法會 GetEraseResultStrokeCollection 回 ,其中包含代表 外部 lassoPoints 之 區段的 Stroke 筆劃。 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

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)

備註

方法會 GetEraseResultStrokeCollection 回 ,其中包含代表 外部 bounds 之 區段的 Stroke 筆劃。 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

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

適用於