Stroke.GetClipResult 方法

定義

回傳位於指定區域內的電流 Stroke 區段。

多載

名稱 Description
GetClipResult(IEnumerable<Point>)

回傳在指定範圍內的電流 Stroke 區段。

GetClipResult(Rect)

回傳位於指定矩形內的電流 Stroke 區段。

GetClipResult(IEnumerable<Point>)

回傳在指定範圍內的電流 Stroke 區段。

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

參數

lassoPoints
IEnumerable<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 clipResults = aStroke.GetClipResult(myPoints);

// inkCanvas1 is the InkCanvas on which we update the strokes
inkCanvas1.Strokes.Remove(aStroke);
inkCanvas1.Strokes.Add(clipResults);
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 clipResults As StrokeCollection = aStroke.GetClipResult(myPoints)

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

備註

GetClipResult方法回StrokeCollectionStroke包含代表 中 的lassoPoints段落的筆劃。 GetClipResult 不會改變原始 Stroke的 。

GetClipResult 方法將前兩點連接起來 lassoPoints ,形成套索。

適用於

GetClipResult(Rect)

回傳位於指定矩形內的電流 Stroke 區段。

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

參數

bounds
Rect

一個 Rect 指定要剪裁的區域。

傳回

StrokeCollection A 包含了在 範圍內Stroke的電流bounds段的副本。

範例

以下範例移除超出指定範圍的墨水。

Rect myRect = new Rect(100, 100, 100, 100);

StrokeCollection clipResults = aStroke.GetClipResult(myRect);

// inkCanvas1 is the InkCanvas on which we update the strokes
inkCanvas1.Strokes.Remove(aStroke);
inkCanvas1.Strokes.Add(clipResults);
Dim myRect As New Rect(100, 100, 100, 100)

Dim clipResults As StrokeCollection = aStroke.GetClipResult(myRect)

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

備註

GetClipResult方法回StrokeCollectionStroke包含代表 中 的bounds段落的筆劃。 GetClipResult 不會改變原始 Stroke的 。

適用於