RectangleStylusShape Class

 

Represents a rectangular stylus tip.

Namespace:   System.Windows.Ink
Assembly:  PresentationCore (in PresentationCore.dll)

System.Object
  System.Windows.Ink.StylusShape
    System.Windows.Ink.RectangleStylusShape

public sealed class RectangleStylusShape : StylusShape

NameDescription
System_CAPS_pubmethodRectangleStylusShape(Double, Double)

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

System_CAPS_pubmethodRectangleStylusShape(Double, Double, Double)

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

NameDescription
System_CAPS_pubpropertyHeight

Gets the height of the stylus.(Inherited from StylusShape.)

System_CAPS_pubpropertyRotation

Gets the angle of the stylus.(Inherited from StylusShape.)

System_CAPS_pubpropertyWidth

Gets the width of the stylus. (Inherited from StylusShape.)

NameDescription
System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

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;
    }
}

.NET Framework
Available since 3.0

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: