語言

StrokeCollection.Clip 方法

定義

移除所有超出指定範圍的筆劃 StrokeCollection 。

多載

名稱 Description
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 ,形成套索。

該 Clip 方法會為 StrokesChanged 每個 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

A 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)

備註

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

適用於