Stroke.GetEraseResult 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | Description |
|---|---|
| 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 A 包含超出指定範圍的電流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 代表 中 Stroke 位於 lassoPoints之外的段的筆劃。
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
參數
傳回
StrokeCollection A 包含超出指定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 代表 中 Stroke 位於 bounds之外的段的筆劃。
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>
- eraserShape
- StylusShape
StylusShape A則指定橡皮擦的形狀。
傳回
StrokeCollection A 包含經指定路徑切割後的電流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 觸,回傳代表切割段的 a StrokeCollection 。
GetEraseResult 不會改變原始 Stroke的 。