Bearbeiten

RectangleStylusShape Constructors

Definition

Initializes a new instance of the RectangleStylusShape class.

Overloads

RectangleStylusShape(Double, Double)

Initializes a new instance of the RectangleStylusShape class with the specified width and height.

RectangleStylusShape(Double, Double, Double)

Initializes a new instance of the RectangleStylusShape class with the specified width, height, and angle.

RectangleStylusShape(Double, Double)

Initializes a new instance of the RectangleStylusShape class with the specified width and height.

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)

Parameters

width
Double

The width of the stylus shape.

height
Double

The height of the stylus shape.

Examples

The following example demonstrates how to use a RectangleStylusShape to perform hit testing on a StrokeCollection. This example assumes that there is an InkPresenter called 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

Applies to

RectangleStylusShape(Double, Double, Double)

Initializes a new instance of the RectangleStylusShape class with the specified width, height, and angle.

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)

Parameters

width
Double

The width of the stylus shape.

height
Double

The height of the stylus shape.

rotation
Double

The angle of the stylus shape.

Examples

The following example demonstrates how to use a RectangleStylusShape to perform hit testing on a StrokeCollection. This example assumes that there is an InkPresenter called 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

Applies to