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

触笔形状的高度。

示例

以下示例演示如何使用 a 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

触笔形状的角度。

示例

以下示例演示如何使用 a 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

适用于