CornerRadii Struct
The radius of each corner of a rounded rectangle. A corner whose radius is zero is not rounded.
public readonly struct CornerRadii : IEquatable<CornerRadii>Remarks
The corners are quarters of a circle. Radii that do not fit are reduced as CSS reduces the radii of a border: when the radii of two corners of a side add up to more than that side, every radius is multiplied by the same factor, the largest one that makes them all fit.
- Implements
Constructors
| Name | Description |
|---|---|
| CornerRadii(double) | Initializes a new instance of the CornerRadii struct whose corners have the same radius. |
| CornerRadii(double, double, double, double) | Initializes a new instance of the CornerRadii struct. |
CornerRadii overloads
CornerRadii(double)
CornerRadii.csInitializes a new instance of the CornerRadii struct whose corners have the same radius.
public CornerRadii(double radius)Parameters
radiusdouble- The radius of every corner. Must be zero or positive.
Exceptions
ArgumentExceptionradiusis not a finite number.ArgumentOutOfRangeExceptionradiusis negative or exceeds 16777216.
CornerRadii(double, double, double, double)
CornerRadii.csInitializes a new instance of the CornerRadii struct.
Parameters
topLeftdouble- The radius of the top-left corner. Must be zero or positive.
topRightdouble- The radius of the top-right corner. Must be zero or positive.
bottomRightdouble- The radius of the bottom-right corner. Must be zero or positive.
bottomLeftdouble- The radius of the bottom-left corner. Must be zero or positive.
Exceptions
ArgumentException- A radius is not a finite number.
ArgumentOutOfRangeException- A radius is negative or exceeds 16777216.
Properties
| Name | Description |
|---|---|
| BottomLeft | Gets the radius of the bottom-left corner. |
| BottomRight | Gets the radius of the bottom-right corner. |
| IsEmpty | Gets a value indicating whether no corner is rounded. |
| TopLeft | Gets the radius of the top-left corner. |
| TopRight | Gets the radius of the top-right corner. |
BottomLeft
CornerRadii.csBottomRight
CornerRadii.csIsEmpty
CornerRadii.csTopLeft
CornerRadii.csTopRight
CornerRadii.csMethods
| Name | Description |
|---|---|
| Equals(CornerRadii) | Indicates whether the current object is equal to another object of the same type. |
| Equals(object?) | Indicates whether this instance and a specified object are equal. |
| GetHashCode() | Returns the hash code for this instance. |
| ToString() | Returns the radii, clockwise from the top-left corner. |
Equals overloads
Equals(CornerRadii)
CornerRadii.csIndicates whether the current object is equal to another object of the same type.
public bool Equals(CornerRadii other)Parameters
otherCornerRadii- An object to compare with this object.
Returns
bool true if the current object is equal to the other parameter; otherwise, false.
Equals(object?)
CornerRadii.csGetHashCode()
CornerRadii.csToString()
CornerRadii.csOperators
| Name | Description |
|---|---|
| operator ==(CornerRadii, CornerRadii) | Determines whether two values have the same radii. |
| operator !=(CornerRadii, CornerRadii) | Determines whether two values have different radii. |
operator ==(CornerRadii, CornerRadii)
CornerRadii.csDetermines whether two values have the same radii.
public static bool operator ==(CornerRadii left, CornerRadii right)Parameters
leftCornerRadii- The first value.
rightCornerRadii- The second value.
Returns
bool true if the radii are equal.
operator !=(CornerRadii, CornerRadii)
CornerRadii.csDetermines whether two values have different radii.
public static bool operator !=(CornerRadii left, CornerRadii right)Parameters
leftCornerRadii- The first value.
rightCornerRadii- The second value.
Returns
bool true if a radius differs.