Rectangle
Rectangle class
Class represents rectangle.
public sealed class Rectangle : ICloneable
Constructors
Name |
Description |
Rectangle(double, double, double, double, bool) |
Constructor of Rectangle. |
Properties
Name |
Description |
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
Name |
Description |
static FromRect(Rectangle) |
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. |
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
Name |
Description |
static Empty |
Empty rectangle |
See Also