共用方式為


RectangleStylusShape 建構函式

定義

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

多載

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

適用於