語言

RectangleStylusShape 建構函式

定義

初始化 RectangleStylusShape 類別的新執行個體。

多載

名稱 Description
RectangleStylusShape(Double, Double)

初始化一個以指定寬度與高度的新類別實例 RectangleStylusShape 。

RectangleStylusShape(Double, Double, Double)

初始化一個新的類別實例 RectangleStylusShape ,包含指定的寬度、高度與角度。

RectangleStylusShape(Double, Double)

初始化一個以指定寬度與高度的新類別實例 RectangleStylusShape 。

public:
 RectangleStylusShape(double width, double height);
public RectangleStylusShape(double width, double height);
new System.Windows.Ink.RectangleStylusShape : double * double -> System.Windows.Ink.RectangleStylusShape
Public Sub New (width As Double, height As Double)

參數

width
Double

觸控筆的寬度。

height
Double

觸控筆形狀的高度。

範例

以下範例示範如何使用 對 RectangleStylusShape 進行命中測試 StrokeCollection。 此範例假設存在一個 InkPresenter 被呼叫 presenter的 。

private void HitTestWithEraser(Point[] points)
{
    RectangleStylusShape eraser = new RectangleStylusShape(3, 3, 0);

    StrokeCollection strokes = presenter.Strokes.HitTest(points, eraser);

    foreach (Stroke s in strokes)
    {
        s.DrawingAttributes.Color = Colors.Purple;
    }
}
Private Sub HitTestWithEraser(ByVal points() As Point)
    Dim eraser As RectangleStylusShape = New RectangleStylusShape(3, 3, 0)

    Dim strokes As StrokeCollection = presenter.Strokes.HitTest(points, eraser)

    Dim s As Stroke
    For Each s In strokes
        s.DrawingAttributes.Color = Colors.Purple
    Next
End Sub

適用於

RectangleStylusShape(Double, Double, Double)

初始化一個新的類別實例 RectangleStylusShape ,包含指定的寬度、高度與角度。

public:
 RectangleStylusShape(double width, double height, double rotation);
public RectangleStylusShape(double width, double height, double rotation);
new System.Windows.Ink.RectangleStylusShape : double * double * double -> System.Windows.Ink.RectangleStylusShape
Public Sub New (width As Double, height As Double, rotation As Double)

參數

width
Double

觸控筆的寬度。

height
Double

觸控筆形狀的高度。

rotation
Double

觸控筆的角度。

範例

以下範例示範如何使用 對 RectangleStylusShape 進行命中測試 StrokeCollection。 此範例假設存在一個 InkPresenter 被呼叫 presenter的 。

private void HitTestWithEraser(Point[] points)
{
    RectangleStylusShape eraser = new RectangleStylusShape(3, 3, 0);

    StrokeCollection strokes = presenter.Strokes.HitTest(points, eraser);

    foreach (Stroke s in strokes)
    {
        s.DrawingAttributes.Color = Colors.Purple;
    }
}
Private Sub HitTestWithEraser(ByVal points() As Point)
    Dim eraser As RectangleStylusShape = New RectangleStylusShape(3, 3, 0)

    Dim strokes As StrokeCollection = presenter.Strokes.HitTest(points, eraser)

    Dim s As Stroke
    For Each s In strokes
        s.DrawingAttributes.Color = Colors.Purple
    Next
End Sub

適用於