xtd - Reference Guide  0.2.0
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
List of all members
xtd::drawing::rectangle Class Reference

#include <rectangle.h>


Stores a set of four integers that represent the location and size of a rectangle.

fill_rectangle.cpp, screen.cpp, and user_control.cpp.


static const rectangle empty


 rectangle ()=default
 rectangle (int32_t x, int32_t y, int32_t width, int32_t height)
 rectangle (const point &location, const drawing::size &size)


int32_t bottom () const
int32_t height () const
void height (int32_t height)
bool is_empty () const
int32_t left () const
void left (int32_t left)
point location () const
void location (const point &location)
int32_t right () const
drawing::size size () const
void size (const drawing::size &size)
int32_t top () const
void top (int32_t top)
int32_t x () const
void x (int32_t x)
int32_t y () const
void y (int32_t y)
int32_t width () const
void width (int32_t width)


bool contains (const point &pt) const
bool contains (const rectangle &rect) const
bool contains (int32_t x, int32_t y) const
void inflate (const drawing::size &sz)
void inflate (int width, int height)
bool intersects_with (const rectangle &rect) const
void make_intersect (const rectangle &rect)
void make_union (const rectangle &rect)
void offset (const point &pt)
void offset (int32_t dx, int32_t dy)
xtd::ustring to_string () const noexcept override
 Returns a std::string that represents the current object. More...
static rectangle ceiling (const rectangle_f &rect)
static rectangle from_ltrb (int32_t left, int32_t top, int32_t right, int32_t bottom)
static rectangle inflate (const rectangle &rect, const drawing::size &sz)
static rectangle inflate (const rectangle &rect, int width, int height)
static rectangle make_intersect (const rectangle &a, const rectangle &b)
static rectangle make_union (const rectangle &a, const rectangle &b)
static rectangle offset (const rectangle &rect, const point &pt)
static rectangle offset (const rectangle &rect, int x, int y)
static rectangle round (const rectangle_f &rect)
static rectangle trunc (const rectangle_f &rect)

Additional Inherited Members

- Public Member Functions inherited from xtd::object
 object ()=default
 Create a new instance of the ultimate base class object. More...
virtual bool equals (const object &obj) const noexcept
 Determines whether the specified object is equal to the current object. More...
virtual size_t get_hash_code () const noexcept
 Serves as a hash function for a particular type. More...
template<typename object_t >
std::unique_ptr< object_t > memberwise_clone () const
 Gets the type of the current instance. More...
- Static Public Member Functions inherited from xtd::object
static bool equals (const object &object_a, const object &object_b) noexcept
 Determines whether the specified object instances are considered equal. More...
static bool reference_equals (const object &object_a, const object &object_b) noexcept
 Determines whether the specified object instances are the same instance. More...

Member Function Documentation

◆ to_string()

xtd::ustring xtd::drawing::rectangle::to_string ( ) const

Returns a std::string that represents the current object.

A string that represents the current object.
The following code example demonstrates what to_string returns.

Reimplemented from xtd::object.

The documentation for this class was generated from the following file: