Rectangle

Rectangle class

Class represents rectangle.

The Rectangle type exposes the following members:

Constructors

NameDescription
Rectangle(llx, lly, urx, ury, normalize_coordinates)Initializes a new instance of the Rectangle class

Properties

NameDescription
widthWidth of rectangle.
heightHeight of rectangle.
llxX-coordinate of lower - left corner.
llyY - coordinate of lower-left corner.
urxX - coordinate of upper-right corner.
uryY - coordinate of upper-right corner.
trivialInitializes trivial rectangle i.e. rectangle with zero position and size.
is_trivialChecks if rectangle is trivial i.e. has zero size and position.
is_emptyChecks if rectangle is empty.
is_pointChecks if rectangle is point i.e. LLX is equal URX and LLY is equal URY.
emptyEmpty rectangle

Methods

NameDescription
rotate(angle)Rotate rectangle by the specified angle.
rotate(angle)Rotate rectangle by the specified angle.
to_rect()Converts rectangle to instance of System.Drawing.Rectangle. Floating-point positions and size are truncated.
from_rect(src)Initializes new rectangle from given instance of System.Drawing.Rectangle.
parse(value)Try to parse string and extract from it rectangle components llx, lly, urx, ury.
equals(other)Check if rectangles are equal i.e. have same position and sizes.
near_equals(other, delta)Check if rectangles are near equal i.e. have near same (up to delta) position and sizes.
intersect(other_rect)Intersects to rectangles.
join(other_rect)Joins rectangles.
is_intersect(other_rect)Determines whether this rectangle intersects with other rectangle.
contains(point)Determinces whether given point is inside of the rectangle.
center()Returncs coordinates of center of the rectangle.
clone()Clones the Rectangle object.
to_points()Converts rectangle into array of points (“QuadPoints”).

See Also