Compartir vía


RectangleStylusShape Constructores

Definición

Inicializa una nueva instancia de la clase RectangleStylusShape.

Sobrecargas

RectangleStylusShape(Double, Double)

Inicializa una nueva instancia de la clase RectangleStylusShape con el ancho y alto especificados.

RectangleStylusShape(Double, Double, Double)

Inicializa una nueva instancia de la clase RectangleStylusShape con el ancho, alto y ángulo especificados.

RectangleStylusShape(Double, Double)

Inicializa una nueva instancia de la clase RectangleStylusShape con el ancho y alto especificados.

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)

Parámetros

width
Double

Ancho de la forma del lápiz óptico.

height
Double

Alto de la forma del lápiz.

Ejemplos

En el ejemplo siguiente se muestra cómo usar para RectangleStylusShape realizar pruebas de posicionamiento en un .StrokeCollection En este ejemplo se supone que hay un InkPresenter elemento denominado 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

Se aplica a

RectangleStylusShape(Double, Double, Double)

Inicializa una nueva instancia de la clase RectangleStylusShape con el ancho, alto y ángulo especificados.

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)

Parámetros

width
Double

Ancho de la forma del lápiz óptico.

height
Double

Alto de la forma del lápiz.

rotation
Double

Ángulo de la forma del lápiz óptico.

Ejemplos

En el ejemplo siguiente se muestra cómo usar para RectangleStylusShape realizar pruebas de posicionamiento en un .StrokeCollection En este ejemplo se supone que hay un InkPresenter elemento denominado 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

Se aplica a