Class RoundedRectangle
Represents an axis-aligned rectangle with uniform rounded corners. Immutable: all operations return new instances.
public sealed class RoundedRectangle : IBounds, IEquatable<RoundedRectangle>
- Inheritance
-
RoundedRectangle
- Implements
- Inherited Members
Constructors
- RoundedRectangle(Rectangle, double)
Initializes a new rounded rectangle from a bounding rectangle and a corner radius.
Properties
- AxisAlignedBounds
Gets the axis-aligned bounding rectangle (same as Bounds).
- Bottom
Gets the vertical position of the bottom edge of the bounds.
- Bounds
Gets the underlying rectangle bounds.
- CornerRadius
Gets the requested corner radius.
- EffectiveCornerRadius
Gets the effective corner radius, clamped to
min(Width, Height) / 2.
- Height
Gets the total vertical extent of the bounds (Bottom minus Top).
- Left
Gets the horizontal position of the left edge of the bounds.
- MidX
Gets the horizontal midpoint of the bounds.
- MidY
Gets the vertical midpoint of the bounds.
- Right
Gets the horizontal position of the right edge of the bounds.
- Top
Gets the vertical position of the top edge of the bounds.
- Width
Gets the total horizontal extent of the bounds (Right minus Left).
Methods
- Contains(double, double)
Determines whether the specified point lies inside this rounded rectangle.
- FromCoordinates(double, double, double, double, double)
Creates a rounded rectangle from edge coordinates and corner radius.
- FromSize(double, double, double, double, double)
Creates a rounded rectangle from position, size, and corner radius.
- ToString()
Returns
RoundedRect(Left, Top, Width x Height, r=CornerRadius).
- Translate(double, double)
Returns a new rounded rectangle translated by the specified offsets.
Operators
- operator ==(RoundedRectangle, RoundedRectangle)
Determines whether two rounded rectangles are equal.
- operator !=(RoundedRectangle, RoundedRectangle)
Determines whether two rounded rectangles are not equal.