Class Rectangle

Rectangle class

Class represents rectangle.

public sealed class Rectangle : ICloneable

Constructors

NameDescription
Rectangle(double, double, double, double, bool)Constructor of Rectangle.

Properties

NameDescription
static Trivial { get; }Initializes trivial rectangle i.e. rectangle with zero position and size.
Height { get; }Height of rectangle.
IsEmpty { get; }Checks if rectangle is empty.
IsPoint { get; }Checks if rectangle is point i.e. LLX is equal URX and LLY is equal URY.
IsTrivial { get; }Checks if rectangle is trivial i.e. has zero size and position.
LLX { get; set; }X-coordinate of lower - left corner.
LLY { get; set; }Y - coordinate of lower-left corner.
URX { get; set; }X - coordinate of upper-right corner.
URY { get; set; }Y - coordinate of upper-right corner.
Width { get; }Width of rectangle.

Methods

NameDescription
static FromRect(Rectangle)Initializes new rectangle from given instance of System.Drawing.Rectangle.
static FromRect(RectangleF)Initializes new rectangle from given instance of System.Drawing.Rectangle.
static Parse(string)Try to parse string and extract from it rectangle components llx, lly, urx, ury.
Center()Returncs coordinates of center of the rectangle.
Clone()Clones the Rectangle object.
Contains(Point)Determinces whether given point is inside of the rectangle.
ContainsLine(double, double, double, double)Determines whether the rectangle contains a line represented by two points.
ContainsPoint(double, double)Determines whether the given point is contained within the rectangle.
Equals(Rectangle)Check if rectangles are equal i.e. have same position and sizes.
Intersect(Rectangle)Intersects to rectangles.
IsIntersect(Rectangle)Determines whether this rectangle intersects with other rectangle.
Join(Rectangle)Joins rectangles.
NearEquals(Rectangle, double)Check if rectangles are near equal i.e. have near same (up to delta) position and sizes.
Rotate(int)Rotate rectangle by the specified angle.
Rotate(Rotation)Rotate rectangle by the specified angle.
ToPoints()Converts rectangle into array of points (“QuadPoints”).
ToRect()Converts rectangle to instance of System.Drawing.Rectangle. Floating-point positions and size are truncated.
override ToString()Gets rectangle string representation.

Fields

NameDescription
static EmptyEmpty rectangle

See Also