Struct RotatedRect
The class represents rotated (i.e. not up-right) rectangles on a plane.
public struct RotatedRect : IConvexPolygonF, IEquatable<RotatedRect>
- Implements
- Inherited Members
Constructors
RotatedRect(PointF, SizeF, float)
Create a RotatedRect structure with the specific parameters
public RotatedRect(PointF center, SizeF size, float angle)
Parameters
center
PointFThe rectangle mass center
size
SizeFWidth and height of the rectangle
angle
floatThe rotation angle. When the angle is 0, 90, 180, 270 etc., the rectangle becomes an up-right rectangle.
Fields
Angle
The rotation angle. When the angle is 0, 90, 180, 270 etc., the rectangle becomes an up-right rectangle.
public float Angle
Field Value
Center
The rectangle mass center
public PointF Center
Field Value
Size
Width and height of the rectangle
public SizeF Size
Field Value
Properties
Empty
Represent an uninitialized RotatedRect
public static RotatedRect Empty { get; }
Property Value
Methods
Equals(RotatedRect)
Returns true if the two box are equal
public bool Equals(RotatedRect other)
Parameters
other
RotatedRectThe other box to compare with
Returns
- bool
True if two boxes are equal
GetVertices()
Get the 4 vertices of this Box.
public PointF[] GetVertices()
Returns
- PointF[]
The vertices of this RotatedRect
MinAreaRect()
Get the minimum enclosing rectangle for this Box
public Rectangle MinAreaRect()
Returns
- Rectangle
The minimum enclosing rectangle for this Box
Offset(int, int)
Shift the box by the specific amount
public void Offset(int x, int y)
Parameters
Operators
implicit operator RotatedRect(RectangleF)
Convert a RectangleF to RotatedRect
public static implicit operator RotatedRect(RectangleF rectangle)
Parameters
rectangle
RectangleFThe rectangle
Returns
- RotatedRect
The equivalent RotatedRect