Stores a set of four integers that represent the location and size of a rectangle.
Public Member Functions | |
void | inflate (const drawing::size &sz) noexcept |
Enlarges this xtd::drawing::rectangle by the specified amount. | |
void | inflate (int32 width, int32 height) noexcept |
Enlarges this xtd::drawing::rectangle by the specified amount. | |
Public Member Functions inherited from xtd::object | |
object ()=default | |
Create a new instance of the ultimate base class object. | |
virtual size_t | get_hash_code () const noexcept |
Serves as a hash function for a particular type. | |
virtual type_object | get_type () const noexcept |
Gets the type of the current instance. | |
template<typename object_t > | |
xtd::uptr< object_t > | memberwise_clone () const |
Creates a shallow copy of the current object. | |
Public Member Functions inherited from xtd::iequatable< rectangle > | |
virtual bool | equals (const rectangle &) const noexcept=0 |
Indicates whether the current object is equal to another object of the same type. | |
Public Fields | |
static const rectangle | empty |
Represents a xtd::drawing::rectangle that has xtd::drawing::rectagle::x, xtd::drawing::rectangle::y, xtd::drawing::rectangle::width and xtd::drawing::rectangle::height values set to zero. | |
Public Constructors | |
rectangle () noexcept=default | |
Initializes a new instance of the xtd::drawing::rectangle class. | |
rectangle (int32 x, int32 y, int32 width, int32 height) noexcept | |
Initializes a new instance of the xtd::drawing::rectangle class with the specified location and size. | |
rectangle (const xtd::drawing::point &location, const xtd::drawing::size &size) noexcept | |
Initializes a new instance of the xtd::drawing::rectangle class with the specified location and size. | |
Public Properties | |
int32 | bottom () const noexcept |
Gets the y-coordinate that is the sum of the xtd::drawing::rectangle::y and xtd::drawing::rectangle::height property values of this xtd::drawing::rectangle structure. | |
point | center () const noexcept |
Gets the center property values of this xtd::drawing::rectangle structure. | |
int32 | height () const noexcept |
Gets the height of this xtd::drawing::rectangle structure. | |
void | height (int32 value) noexcept |
Sets the height of this xtd::drawing::rectangle structure. | |
bool | is_empty () const noexcept |
Tests whether all numeric properties of this xtd::drawing::rectangle have values of zero. | |
int32 | left () const noexcept |
Gets the x-coordinate of the left edge of this xtd::drawing::rectangle structure. | |
xtd::drawing::point | location () const noexcept |
Gets the coordinates of the upper-left corner of this xtd::drawing::rectangle structure. | |
void | location (const xtd::drawing::point &value) noexcept |
Sets the coordinates of the upper-left corner of this xtd::drawing::rectangle structure. | |
int32 | right () const noexcept |
Gets the x-coordinate that is the sum of xtd::drawing::rectangle::x and xtd::drawing::rectangle::width property values of this xtd::drawing::rectangle structure. | |
xtd::drawing::size | size () const noexcept |
Gets the size of this xtd::drawing::rectangle. | |
void | size (const xtd::drawing::size &value) noexcept |
Sets the size of this xtd::drawing::rectangle. | |
int32 | top () const noexcept |
Gets the y-coordinate of the top edge of this xtd::drawing::rectangle structure. | |
int32 | width () const noexcept |
Gets the width of this xtd::drawing::rectangle structure. | |
void | width (int32 value) noexcept |
Sets the width of this xtd::drawing::rectangle structure. | |
int32 | x () const noexcept |
Gets the x-coordinate of the upper-left corner of this xtd::drawing::rectangle structure. | |
void | x (int32 value) noexcept |
Sets the x-coordinate of the upper-left corner of this xtd::drawing::rectangle structure. | |
int32 | y () const noexcept |
Gets the y-coordinate of the upper-left corner of this xtd::drawing::rectangle structure. | |
void | y (int32 value) noexcept |
Sets the y-coordinate of the upper-left corner of this xtd::drawing::rectangle structure. | |
Public Methods | |
void | add (const drawing::size &sz) noexcept |
Adds this xtd::drawing::rectangle by the specified amount. | |
void | add (int32 width, int32 height) noexcept |
Adds this xtd::drawing::rectangle by the specified amount. | |
bool | contains (const xtd::drawing::point &pt) const noexcept |
Determines if the specified point is contained within this xtd::drawing::rectangle structure. | |
bool | contains (const xtd::drawing::rectangle &rect) const noexcept |
Determines if the rectangular region represented by rect is entirely contained within this xtd::drawing::rectangle structure. | |
bool | contains (int32 x, int32 y) const noexcept |
Determines if the specified point is contained within this xtd::drawing::rectangle structure. | |
bool | equals (const rectangle &value) const noexcept override |
bool | intersects_with (const rectangle &rect) const noexcept |
Determines if this rectangle intersects with rect. | |
void | make_intersect (const rectangle &rect) noexcept |
Replaces this xtd::drawing::rectangle with the intersection of itself and the specified xtd::drawing::rectangle. | |
void | make_union (const rectangle &rect) noexcept |
Replaces this xtd::drawing::rectangle with the union of itself and the specified xtd::drawing::rectangle. | |
void | offset (const point &pos) noexcept |
Adjusts the location of this rectangle by the specified amount. | |
void | offset (int32 x, int32 y) noexcept |
Adjusts the location of this rectangle by the specified amount. | |
xtd::string | to_string () const noexcept override |
Converts the attributes of this xtd::drawing::rectangle to a human-readable string. | |
virtual bool | equals (const object &obj) const noexcept |
Determines whether the specified object is equal to the current object. | |
template<typename object_a_t , typename object_b_t > | |
static bool | equals (const object_a_t &object_a, const object_b_t &object_b) noexcept |
Determines whether the specified object instances are considered equal. | |
Public Static Methods | |
static rectangle | add (const rectangle &rect, int32 x, int32 y) noexcept |
Creates and returns an added copy of the specified xtd::drawing::rectangle structure. The copy is added by the specified amount. The original xtd::drawing::rectangle structure remains unmodified. | |
static rectangle | add (const rectangle &rect, const drawing::size &sz) noexcept |
Creates and returns an added copy of the specified xtd::drawing::rectangle structure. The copy is added by the specified amount. The original xtd::drawing::rectangle structure remains unmodified. | |
static rectangle | ceiling (const xtd::drawing::rectangle_f &rect) noexcept |
Converts the specified xtd::drawing::rectangle_f structure to a xtd::drawing::rectangle structure by rounding the xtd::drawing::rectangle_f values to the next higher integer values. | |
static rectangle | from_ltrb (int32 left, int32 top, int32 right, int32 bottom) noexcept |
Creates a xtd::drawing::rectangle structure with the specified edge locations. | |
static rectangle | inflate (const rectangle &rect, int32 x, int32 y) noexcept |
Creates and returns an enlarged copy of the specified xtd::drawing::rectangle structure. The copy is enlarged by the specified amount. The original xtd::drawing::rectangle structure remains unmodified. | |
static rectangle | inflate (const rectangle &rect, const drawing::size &sz) noexcept |
Creates and returns an enlarged copy of the specified xtd::drawing::rectangle structure. The copy is enlarged by the specified amount. The original xtd::drawing::rectangle structure remains unmodified. | |
static rectangle | make_intersect (const rectangle &a, const rectangle &b) noexcept |
Returns a third xtd::drawing::rectangle structure that represents the intersection of two other xtd::drawing::rectangle structures. If there is no intersection, an empty xtd::drawing::rectangle is returned. | |
static rectangle | make_union (const rectangle &a, const rectangle &b) noexcept |
Gets a xtd::drawing::rectangle structure that contains the union of two xtd::drawing::rectangle structures. | |
static rectangle | offset (const rectangle &rect, const point &pos) noexcept |
Creates and returns an offsetted copy of the specified xtd::drawing::rectangle structure. The copy is offsetted by the specified amount. The original xtd::drawing::rectangle structure remains unmodified. | |
static rectangle | offset (const rectangle &rect, int32 x, int32 y) noexcept |
Creates and returns an offsetted copy of the specified xtd::drawing::rectangle structure. The copy is offsetted by the specified amount. The original xtd::drawing::rectangle structure remains unmodified. | |
static rectangle | round (const rectangle_f &rect) noexcept |
Converts the specified xtd::drawing::rectangle_f to a xtd::drawing::rectangle by rounding the xtd::drawing::rectangle_f values to the nearest integer values. | |
static rectangle | truncate (const rectangle_f &rect) noexcept |
Converts the specified xtd::drawing::rectangle_f to a xtd::drawing::rectangle by truncating the xtd::drawing::rectangle_f values. | |
Additional Inherited Members | |
Static Public Member Functions inherited from xtd::object | |
template<typename object_a_t , typename object_b_t > | |
static bool | equals (const object_a_t &object_a, const object_b_t &object_b) noexcept |
Determines whether the specified object instances are considered equal. | |
template<typename object_a_t , typename object_b_t > | |
static bool | reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept |
Determines whether the specified object instances are the same instance. | |
|
defaultnoexcept |
Initializes a new instance of the xtd::drawing::rectangle class.
Initializes a new instance of the xtd::drawing::rectangle class with the specified location and size.
x | The x-coordinate of the upper-left corner of the rectangle. |
y | The y-coordinate of the upper-left corner of the rectangle. |
width | The width of the rectangle. |
height | The height of the rectangle. |
|
noexcept |
Initializes a new instance of the xtd::drawing::rectangle class with the specified location and size.
location | A xtd::drawing::point that represents the upper-left corner of the rectangular region. |
size | A xtd::drawing::size that represents the width and height of the rectangular region. |
|
noexcept |
Gets the y-coordinate that is the sum of the xtd::drawing::rectangle::y and xtd::drawing::rectangle::height property values of this xtd::drawing::rectangle structure.
|
noexcept |
Gets the center property values of this xtd::drawing::rectangle structure.
|
noexcept |
Gets the height of this xtd::drawing::rectangle structure.
|
noexcept |
Sets the height of this xtd::drawing::rectangle structure.
value | The height of this Rectangle structure. The default is 0. |
|
noexcept |
Tests whether all numeric properties of this xtd::drawing::rectangle have values of zero.
|
noexcept |
Gets the x-coordinate of the left edge of this xtd::drawing::rectangle structure.
|
noexcept |
Gets the coordinates of the upper-left corner of this xtd::drawing::rectangle structure.
|
noexcept |
Sets the coordinates of the upper-left corner of this xtd::drawing::rectangle structure.
value | A xtd::drawing::point that represents the upper-left corner of this xtd::drawing::rectangle structure. |
|
noexcept |
Gets the x-coordinate that is the sum of xtd::drawing::rectangle::x and xtd::drawing::rectangle::width property values of this xtd::drawing::rectangle structure.
|
noexcept |
Gets the size of this xtd::drawing::rectangle.
|
noexcept |
Sets the size of this xtd::drawing::rectangle.
value | A xtd::drawing::size that represents the width and height of this xtd::drawing::rectangle structure. |
|
noexcept |
Gets the y-coordinate of the top edge of this xtd::drawing::rectangle structure.
|
noexcept |
Gets the width of this xtd::drawing::rectangle structure.
|
noexcept |
Sets the width of this xtd::drawing::rectangle structure.
value | The width of this xtd::drawing::rectangle structure. The default is 0. |
|
noexcept |
Gets the x-coordinate of the upper-left corner of this xtd::drawing::rectangle structure.
|
noexcept |
Sets the x-coordinate of the upper-left corner of this xtd::drawing::rectangle structure.
value | The x-coordinate of the upper-left corner of this xtd::drawing::rectangle structure. The default is 0. |
|
noexcept |
Gets the y-coordinate of the upper-left corner of this xtd::drawing::rectangle structure.
|
noexcept |
Sets the y-coordinate of the upper-left corner of this xtd::drawing::rectangle structure.
value | The y-coordinate of the upper-left corner of this xtd::drawing::rectangle structure. The default is 0. |
|
noexcept |
Adds this xtd::drawing::rectangle by the specified amount.
sz | The amount to add this rectangle. |
Adds this xtd::drawing::rectangle by the specified amount.
width | The amount to add this xtd::drawing::rectangle horizontally. |
height | The amount to add this xtd::drawing::rectangle verticaly. |
|
noexcept |
Determines if the specified point is contained within this xtd::drawing::rectangle structure.
pt | The xtd::drawing::point to test. |
|
noexcept |
Determines if the rectangular region represented by rect is entirely contained within this xtd::drawing::rectangle structure.
rect | The xtd::drawing::rectangle to test. |
Determines if the specified point is contained within this xtd::drawing::rectangle structure.
x | The x-coordinate of the point to test. |
y | The y-coordinate of the point to test. |
|
noexcept |
Determines if this rectangle intersects with rect.
rect | The rectangle to test. |
|
noexcept |
Replaces this xtd::drawing::rectangle with the intersection of itself and the specified xtd::drawing::rectangle.
rect | The xtd::drawing::rectangle with which to intersect. |
|
noexcept |
Replaces this xtd::drawing::rectangle with the union of itself and the specified xtd::drawing::rectangle.
rect | The xtd::drawing::rectangle with which to union. |
|
noexcept |
Adjusts the location of this rectangle by the specified amount.
pos | Amount to offset the location. |
Adjusts the location of this rectangle by the specified amount.
x | The horizontal offset. |
y | The vertical offset. |
|
overridevirtualnoexcept |
Converts the attributes of this xtd::drawing::rectangle to a human-readable string.
Reimplemented from xtd::object.
|
noexcept |
Enlarges this xtd::drawing::rectangle by the specified amount.
sz | The amount to inflate this rectangle. |
Enlarges this xtd::drawing::rectangle by the specified amount.
width | The amount to inflate this xtd::drawing::rectangle horizontally. |
height | The amount to inflate this xtd::drawing::rectangle verticaly. |
|
staticnoexcept |
Creates and returns an added copy of the specified xtd::drawing::rectangle structure. The copy is added by the specified amount. The original xtd::drawing::rectangle structure remains unmodified.
rect | The xtd::drawing::rectangle with which to start. This rectangle is not modified. |
x | The amount to add the specified rectangle horizontally. |
y | The amount to add the specified rectangle vertically. |
|
staticnoexcept |
Creates and returns an added copy of the specified xtd::drawing::rectangle structure. The copy is added by the specified amount. The original xtd::drawing::rectangle structure remains unmodified.
rect | The xtd::drawing::rectangle with which to start. This rectangle is not modified. |
sz | The amount to add the specified rectangle. |
|
staticnoexcept |
Converts the specified xtd::drawing::rectangle_f structure to a xtd::drawing::rectangle structure by rounding the xtd::drawing::rectangle_f values to the next higher integer values.
rect | The xtd::drawing::rectangle_f structure to be converted. |
|
staticnoexcept |
Creates a xtd::drawing::rectangle structure with the specified edge locations.
left | The x-coordinate of the upper-left corner of this xtd::drawing::rectangle structure. |
top | The y-coordinate of the upper-left corner of this xtd::drawing::rectangle structure. |
right | The x-coordinate of the lower-right corner of this xtd::drawing::rectangle structure. |
bottom | The y-coordinate of the lower-right corner of this xtd::drawing::rectangle structure. |
|
staticnoexcept |
Creates and returns an enlarged copy of the specified xtd::drawing::rectangle structure. The copy is enlarged by the specified amount. The original xtd::drawing::rectangle structure remains unmodified.
rect | The xtd::drawing::rectangle with which to start. This rectangle is not modified. |
x | The amount to inflate the specified rectangle horizontally. |
y | The amount to inflate the specified rectangle vertically. |
|
staticnoexcept |
Creates and returns an enlarged copy of the specified xtd::drawing::rectangle structure. The copy is enlarged by the specified amount. The original xtd::drawing::rectangle structure remains unmodified.
rect | The xtd::drawing::rectangle with which to start. This rectangle is not modified. |
sz | The amount to inflate the specified rectangle. |
|
staticnoexcept |
Returns a third xtd::drawing::rectangle structure that represents the intersection of two other xtd::drawing::rectangle structures. If there is no intersection, an empty xtd::drawing::rectangle is returned.
a | A rectangle to intersect. |
b | A rectangle to intersect. |
|
staticnoexcept |
Gets a xtd::drawing::rectangle structure that contains the union of two xtd::drawing::rectangle structures.
a | A rectangle to union. |
b | A rectangle to union. |
|
staticnoexcept |
Creates and returns an offsetted copy of the specified xtd::drawing::rectangle structure. The copy is offsetted by the specified amount. The original xtd::drawing::rectangle structure remains unmodified.
rect | The xtd::drawing::rectangle with which to start. This rectangle is not modified. |
pos | The amount to offset the specified rectangle. |
|
staticnoexcept |
Creates and returns an offsetted copy of the specified xtd::drawing::rectangle structure. The copy is offsetted by the specified amount. The original xtd::drawing::rectangle structure remains unmodified.
rect | The xtd::drawing::rectangle with which to start. This rectangle is not modified. |
x | The amount to offset the specified rectangle horizontally. |
y | The amount to offset the specified rectangle vertically. |
|
staticnoexcept |
Converts the specified xtd::drawing::rectangle_f to a xtd::drawing::rectangle by rounding the xtd::drawing::rectangle_f values to the nearest integer values.
rect | The xtd::drawing::rectangle_f to be converted. |
|
staticnoexcept |
Converts the specified xtd::drawing::rectangle_f to a xtd::drawing::rectangle by truncating the xtd::drawing::rectangle_f values.
rect | The xtd::drawing::rectangle_f to be converted. |
|
virtualnoexcept |
Determines whether the specified object is equal to the current object.
obj | The object to compare with the current object. |
Reimplemented from xtd::object.
|
inlinestaticnoexcept |
Determines whether the specified object instances are considered equal.
object_a | The first object to compare. |
object_b | The second object to compare. |
|
static |
Represents a xtd::drawing::rectangle that has xtd::drawing::rectagle::x, xtd::drawing::rectangle::y, xtd::drawing::rectangle::width and xtd::drawing::rectangle::height values set to zero.