StrokeCollection.Clip 方法

定義

移除 StrokeCollection 中超出指定界限的所有筆劃。

多載

Clip(IEnumerable<Point>)

移除 StrokeCollection 中超出指定之 Point 陣列界限的所有筆劃。

Clip(Rect)

將以指定矩形裁剪的所有筆劃取代為未超過指定矩形的新筆劃。

Clip(IEnumerable<Point>)

移除 StrokeCollection 中超出指定之 Point 陣列界限的所有筆劃。

public:
 void Clip(System::Collections::Generic::IEnumerable<System::Windows::Point> ^ lassoPoints);
public void Clip (System.Collections.Generic.IEnumerable<System.Windows.Point> lassoPoints);
member this.Clip : seq<System.Windows.Point> -> unit
Public Sub Clip (lassoPoints As IEnumerable(Of Point))

參數

lassoPoints
IEnumerable<Point>

Point 型別的陣列,指定要裁剪的區域。

範例

下列範例示範如何在 中 StrokeCollection 裁剪筆劃。 此範例假設有 InkPresenter 名為 presenter 的 。

// Clip the selected strokes.
public void ClipStrokes(Stroke lasso)
{
    Point[] strokePoints = (Point[])lasso.StylusPoints;
    presenter.Strokes.Clip(strokePoints);
}
' Clip the selected strokes.
Public Overloads Sub ClipStrokes(ByVal lasso As Stroke)

    If lasso Is Nothing Then
        Return
    End If

    Dim strokePoints() As Point = CType(lasso.StylusPoints, Point())
    presenter.Strokes.Clip(strokePoints)

End Sub

備註

方法會 Clip 連接 中的 lassoPoints 第一個和最後一個點,以建立套索。

方法 ClipStrokesChanged 針對它裁剪的每個 Stroke 引發 事件。

適用於

Clip(Rect)

將以指定矩形裁剪的所有筆劃取代為未超過指定矩形的新筆劃。

public:
 void Clip(System::Windows::Rect bounds);
public void Clip (System.Windows.Rect bounds);
member this.Clip : System.Windows.Rect -> unit
Public Sub Clip (bounds As Rect)

參數

bounds
Rect

指定要裁剪之區域的 Rect

範例

下列範例示範如何清除 超出 界限的 Rect 筆跡。 此範例假設有 InkPresenter 名為 presenter 的 。

Rect rect = new Rect(100, 100, 200, 200);
presenter.Strokes.Clip(rect);
Dim rect As Rect = New Rect(100, 100, 200, 200)
presenter.Strokes.Clip(rect)

備註

會移除完全超出指定矩形的所有筆劃。

適用於