xtd 0.2.0
Loading...
Searching...
No Matches
xtd::drawing::rectangle_f Class Reference
Inheritance diagram for xtd::drawing::rectangle_f:
xtd::object xtd::iequatable< rectangle_f > xtd::interface xtd::equality_operators< type_t, equatable_t >

Definition

Stores a set of four floating-point numbers that represent the location and size of a rectangle. For more advanced region functions, use a xtd::drawing::region object.

Stores a set of four floating-point numbers that represent the location and size of a rectangle....
Definition rectangle_f.hpp:34
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:42
#define drawing_export_
Define shared library export.
Definition drawing_export.hpp:13
Inheritance
xtd::objectxtd::drawing::rectangle_f
Namespace
xtd::drawing
Library
xtd.drawing
Remarks
A rectangle is defined by its width, height, and upper-left corner.

Public Fields

static const rectangle_f empty
 Represents a xtd::drawing::rectangle_F that has xtd::drawing::rectagle_f::x, xtd::drawing::rectangle_f::y, xtd::drawing::rectangle_f::width and xtd::drawing::rectangle_f::height values set to zero.
 

Public Constructors

 rectangle_f () noexcept=default
 Initializes a new instance of the xtd::drawing::rectagle_f class.
 
 rectangle_f (float x, float y, float width, float height) noexcept
 Initializes a new instance of the xtd::drawing::rectagle_f class with the specified location and size.
 
 rectangle_f (const point_f &location, const size_f &size) noexcept
 Initializes a new instance of the xtd::drawing::rectagle_f class with the specified location and size.
 

Public Properties

float bottom () const noexcept
 Gets the y-coordinate that is the sum of the xtd::drawing::rectangle_f::y and xtd::drawing::rectangle_f::height property values of this xtd::drawing::rectangle_f structure.
 
point_f center () const noexcept
 Gets the center property values of this xtd::drawing::rectangle structure.
 
float height () const noexcept
 Gets the height of this xtd::drawing::rectangle_f structure.
 
void height (float height) noexcept
 Sets the height of this xtd::drawing::rectangle_f structure.
 
bool is_empty () const noexcept
 Tests whether all numeric properties of this xtd::drawing::rectangle_f have values of zero.
 
float left () const noexcept
 Gets the x-coordinate of the left edge of this xtd::drawing::rectangle_f structure.
 
point_f location () const noexcept
 Gets the coordinates of the upper-left corner of this xtd::drawing::rectangle_f structure.
 
void location (const point_f &location)
 Sets the coordinates of the upper-left corner of this xtd::drawing::rectangle_f structure.
 
float right () const noexcept
 Gets the x-coordinate that is the sum of xtd::drawing::rectangle_f::x and xtd::drawing::rectangle_f::width property values of this xtd::drawing::rectangle_f structure.
 
size_f size () const noexcept
 Gets the size of this xtd::drawing::rectangle_f.
 
void size (const size_f &size) noexcept
 Sets the size of this xtd::drawing::rectangle_f.
 
float top () const noexcept
 Gets the y-coordinate of the top edge of this xtd::drawing::rectangle_f structure.
 
float width () const noexcept
 Gets the width of this xtd::drawing::rectangle_f structure.
 
void width (float width) noexcept
 Sets the width of this xtd::drawing::rectangle_f structure.
 
float x () const noexcept
 Gets the x-coordinate of the upper-left corner of this xtd::drawing::rectangle_f structure.
 
void x (float x) noexcept
 Sets the x-coordinate of the upper-left corner of this xtd::drawing::rectangle_f structure.
 
float y () const noexcept
 Gets the y-coordinate of the upper-left corner of this xtd::drawing::rectangle_f structure.
 
void y (float y) noexcept
 Sets the y-coordinate of the upper-left corner of this xtd::drawing::rectangle_f structure.
 

Public Methods

void add (const drawing::size_f &sz) noexcept
 Adds this xtd::drawing::rectangle_f by the specified amount.
 
void add (float width, float height) noexcept
 Adds this xtd::drawing::rectangle_f by the specified amount.
 
bool contains (const point_f &pt) const noexcept
 Determines if the specified point is contained within this xtd::drawing::rectangle_f structure.
 
bool contains (const rectangle_f &rect) const noexcept
 Determines if the rectangular region represented by rect is entirely contained within this xtd::drawing::rectangle_f structure.
 
bool contains (float x, float y) const noexcept
 Determines if the specified point is contained within this xtd::drawing::rectangle_f structure.
 
bool equals (const rectangle_f &value) const noexcept override
 
void inflate (const drawing::size_f &sz) noexcept
 Enlarges this xtd::drawing::rectangle_f by the specified amount.
 
void inflate (float width, float height) noexcept
 Enlarges this xtd::drawing::rectangle_f by the specified amount.
 
bool intersects_with (const rectangle_f &rect) const noexcept
 Determines if this rectangle intersects with rect.
 
void make_intersect (const rectangle_f &rect) noexcept
 Replaces this xtd::drawing::rectangle_f with the intersection of itself and the specified xtd::drawing::rectangle_f.
 
void make_union (const rectangle_f &rect) noexcept
 Replaces this xtd::drawing::rectangle_f with the union of itself and the specified xtd::drawing::rectangle_f.
 
void offset (const point_f &pos) noexcept
 Adjusts the location of this rectangle by the specified amount.
 
void offset (float x, float 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_f to a human-readable string.
 
virtual bool equals (const object &obj) const noexcept
 Determines whether the specified object is equal to the current object.
 
static rectangle_f add (const rectangle_f &rect, float x, float y) noexcept
 Creates and returns an added copy of the specified xtd::drawing::rectangle_f structure. The copy is added by the specified amount. The original xtd::drawing::rectangle_f structure remains unmodified.
 
static rectangle_f add (const rectangle_f &rect, const drawing::size_f &sz) noexcept
 Creates and returns an added copy of the specified xtd::drawing::rectangle_f structure. The copy is added by the specified amount. The original xtd::drawing::rectangle_f structure remains unmodified.
 
static rectangle_f from_ltrb (float left, float top, float right, float bottom) noexcept
 Creates a xtd::drawing::rectangle_f structure with the specified edge locations.
 
static rectangle_f inflate (const rectangle_f &rect, const drawing::size_f &sz) noexcept
 Creates and returns an enlarged copy of the specified xtd::drawing::rectangle_f structure. The copy is enlarged by the specified amount. The original xtd::drawing::rectangle_f structure remains unmodified.
 
static rectangle_f inflate (const rectangle_f &rect, float width, float height) noexcept
 Creates and returns an enlarged copy of the specified xtd::drawing::rectangle_f structure. The copy is enlarged by the specified amount. The original xtd::drawing::rectangle_f structure remains unmodified.
 
static rectangle_f make_intersect (const rectangle_f &a, const rectangle_f &b) noexcept
 Returns a third xtd::drawing::rectangle_f structure that represents the intersection of two other xtd::drawing::rectangle_f structures. If there is no intersection, an empty xtd::drawing::rectangle_f is returned.
 
static rectangle_f make_union (const rectangle_f &a, const rectangle_f &b) noexcept
 Gets a xtd::drawing::rectangle_f structure that contains the union of two xtd::drawing::rectangle_f structures.
 
static rectangle_f offset (const rectangle_f &rect, const point_f &pos) noexcept
 Creates and returns an offsetted copy of the specified xtd::drawing::rectangle_f structure. The copy is offsetted by the specified amount. The original xtd::drawing::rectangle_f structure remains unmodified.
 
static rectangle_f offset (const rectangle_f &rect, float x, float y) noexcept
 Creates and returns an offsetted copy of the specified xtd::drawing::rectangle_f structure. The copy is offsetted by the specified amount. The original xtd::drawing::rectangle_f structure remains unmodified.
 
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.
 

Additional Inherited Members

- 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_f >
virtual bool equals (const rectangle_f &) const noexcept=0
 Indicates whether the current object is equal to another object of the same type.
 
- 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.
 

Constructor & Destructor Documentation

◆ rectangle_f() [1/3]

xtd::drawing::rectangle_f::rectangle_f ( )
defaultnoexcept

Initializes a new instance of the xtd::drawing::rectagle_f class.

Remarks
xtd::drawing::rectagle_f::x, xtd::drawing::rectagle_f::y, xtd::drawing::rectagle_f::width and xtd::drawing::rectagle_f::height values are set to zero.

◆ rectangle_f() [2/3]

xtd::drawing::rectangle_f::rectangle_f ( float  x,
float  y,
float  width,
float  height 
)
noexcept

Initializes a new instance of the xtd::drawing::rectagle_f class with the specified location and size.

Parameters
xThe x-coordinate of the upper-left corner of the rectangle.
yThe y-coordinate of the upper-left corner of the rectangle.
widthThe width of the rectangle.
heightThe height of the rectangle.

◆ rectangle_f() [3/3]

xtd::drawing::rectangle_f::rectangle_f ( const point_f location,
const size_f size 
)
noexcept

Initializes a new instance of the xtd::drawing::rectagle_f class with the specified location and size.

Parameters
locationA xtd::drawing::point_f that represents the upper-left corner of the rectangular region.
sizeA xtd::drawing::size_f that represents the width and height of the rectangular region.

Member Function Documentation

◆ bottom()

float xtd::drawing::rectangle_f::bottom ( ) const
noexcept

Gets the y-coordinate that is the sum of the xtd::drawing::rectangle_f::y and xtd::drawing::rectangle_f::height property values of this xtd::drawing::rectangle_f structure.

Returns
The y-coordinate that is the sum of xtd::drawing::rectangle_f::y and xtd::drawing::rectangle_f::height of this xtd::drawing::rectangle_f.
Remarks
The value of the xtd::drawing::rectangle_f::bottom property represents the y-coordinate of the first point at the bottom edge of the xtd::drawing::rectangle_f that is not contained in the xtd::drawing::rectangle_f.

◆ center()

point_f xtd::drawing::rectangle_f::center ( ) const
noexcept

Gets the center property values of this xtd::drawing::rectangle structure.

Returns
The center of this xtd::drawing::rectangle.

◆ height() [1/2]

float xtd::drawing::rectangle_f::height ( ) const
noexcept

Gets the height of this xtd::drawing::rectangle_f structure.

Returns
The height of this Rectangle structure. The default is 0.
Remarks
Changing the xtd::drawing::rectangle_f::height property will also cause a change in the xtd::drawing::rectangle_f::bottom property of the xtd::drawing::rectangle_f. The units the rectangle is drawn in is determined by the xtd::drawing::graphics::page_unit and xtd::drawing::graphics::page_scale properties of the graphics object used for drawing. The default unit is pixels.

◆ height() [2/2]

void xtd::drawing::rectangle_f::height ( float  height)
noexcept

Sets the height of this xtd::drawing::rectangle_f structure.

Parameters
valueThe height of this Rectangle structure. The default is 0.
Remarks
Changing the xtd::drawing::rectangle_f::height property will also cause a change in the xtd::drawing::rectangle_f::bottom property of the xtd::drawing::rectangle_f. The units the rectangle is drawn in is determined by the xtd::drawing::graphics::page_unit and xtd::drawing::graphics::page_scale properties of the graphics object used for drawing. The default unit is pixels.

◆ is_empty()

bool xtd::drawing::rectangle_f::is_empty ( ) const
noexcept

Tests whether all numeric properties of this xtd::drawing::rectangle_f have values of zero.

Returns
This property returns true if the xtd::drawing::rectangle_f::width, xtd::drawing::rectangle_f::height, xtd::drawing::rectangle_f::x, and xtd::drawing::rectangle_f::y properties of this xtd::drawing::rectangle_f all have values of zero; otherwise, false.

◆ left()

float xtd::drawing::rectangle_f::left ( ) const
noexcept

Gets the x-coordinate of the left edge of this xtd::drawing::rectangle_f structure.

Returns
The x-coordinate of the left edge of this xtd::drawing::rectangle_f structure.

◆ location() [1/2]

point_f xtd::drawing::rectangle_f::location ( ) const
noexcept

Gets the coordinates of the upper-left corner of this xtd::drawing::rectangle_f structure.

Returns
A xtd::drawing::point_f that represents the upper-left corner of this xtd::drawing::rectangle_f structure.

◆ location() [2/2]

void xtd::drawing::rectangle_f::location ( const point_f location)

Sets the coordinates of the upper-left corner of this xtd::drawing::rectangle_f structure.

Parameters
valueA xtd::drawing::point_f that represents the upper-left corner of this xtd::drawing::rectangle_f structure.

◆ right()

float xtd::drawing::rectangle_f::right ( ) const
noexcept

Gets the x-coordinate that is the sum of xtd::drawing::rectangle_f::x and xtd::drawing::rectangle_f::width property values of this xtd::drawing::rectangle_f structure.

Returns
The x-coordinate that is the sum of xtd::drawing::rectangle_f::x and xtd::drawing::rectangle_f::width of this xtd::drawing::rectangle_f.

◆ size() [1/2]

size_f xtd::drawing::rectangle_f::size ( ) const
noexcept

Gets the size of this xtd::drawing::rectangle_f.

Returns
A xtd::drawing::size_f that represents the width and height of this xtd::drawing::rectangle_f structure.

◆ size() [2/2]

void xtd::drawing::rectangle_f::size ( const size_f size)
noexcept

Sets the size of this xtd::drawing::rectangle_f.

Parameters
valueA xtd::drawing::size_f that represents the width and height of this xtd::drawing::rectangle_f structure.

◆ top()

float xtd::drawing::rectangle_f::top ( ) const
noexcept

Gets the y-coordinate of the top edge of this xtd::drawing::rectangle_f structure.

Returns
The y-coordinate of the top edge of this xtd::drawing::rectangle_f structure.

◆ width() [1/2]

float xtd::drawing::rectangle_f::width ( ) const
noexcept

Gets the width of this xtd::drawing::rectangle_f structure.

Returns
The width of this xtd::drawing::rectangle_f structure. The default is 0.
Remarks
Changing the xtd::drawing::rectangle_f::width property will also cause a change in the xtd::drawing::rectangle_f::bottom property of the xtd::drawing::rectangle_f. The units the rectangle is drawn in is determined by the xtd::drawing::graphics::page_unit and xtd::drawing::graphics::page_scale properties of the graphics object used for drawing. The default unit is pixels.

◆ width() [2/2]

void xtd::drawing::rectangle_f::width ( float  width)
noexcept

Sets the width of this xtd::drawing::rectangle_f structure.

Parameters
valueThe width of this xtd::drawing::rectangle_f structure. The default is 0.
Remarks
Changing the xtd::drawing::rectangle_f::width property will also cause a change in the xtd::drawing::rectangle_f::bottom property of the xtd::drawing::rectangle_f. The units the rectangle is drawn in is determined by the xtd::drawing::graphics::page_unit and xtd::drawing::graphics::page_scale properties of the graphics object used for drawing. The default unit is pixels.

◆ x() [1/2]

float xtd::drawing::rectangle_f::x ( ) const
noexcept

Gets the x-coordinate of the upper-left corner of this xtd::drawing::rectangle_f structure.

Returns
The x-coordinate of the upper-left corner of this xtd::drawing::rectangle_f structure. The default is 0.
Remarks
Changing the xtd::drawing::rectangle_f::x property will also cause a change in the xtd::drawing::rectangle_f::right property of the xtd::drawing::rectangle_f.

◆ x() [2/2]

void xtd::drawing::rectangle_f::x ( float  x)
noexcept

Sets the x-coordinate of the upper-left corner of this xtd::drawing::rectangle_f structure.

Parameters
valueThe x-coordinate of the upper-left corner of this xtd::drawing::rectangle_f structure. The default is 0.
Remarks
Changing the xtd::drawing::rectangle_f::x property will also cause a change in the xtd::drawing::rectangle_f::right property of the xtd::drawing::rectangle_f.

◆ y() [1/2]

float xtd::drawing::rectangle_f::y ( ) const
noexcept

Gets the y-coordinate of the upper-left corner of this xtd::drawing::rectangle_f structure.

Returns
The y-coordinate of the upper-left corner of this xtd::drawing::rectangle_f structure. The default is 0.
Remarks
Changing the xtd::drawing::rectangle_f::y property will also cause a change in the xtd::drawing::rectangle_f::bottom property of the xtd::drawing::rectangle_f.

◆ y() [2/2]

void xtd::drawing::rectangle_f::y ( float  y)
noexcept

Sets the y-coordinate of the upper-left corner of this xtd::drawing::rectangle_f structure.

Parameters
valueThe y-coordinate of the upper-left corner of this xtd::drawing::rectangle_f structure. The default is 0.
Remarks
Changing the xtd::drawing::rectangle_f::y property will also cause a change in the xtd::drawing::rectangle_f::bottom property of the xtd::drawing::rectangle_f.

◆ add() [1/4]

void xtd::drawing::rectangle_f::add ( const drawing::size_f sz)
noexcept

Adds this xtd::drawing::rectangle_f by the specified amount.

Parameters
szThe amount to add this rectangle.
Remarks
This method adds this rectangle, not a copy of it.

◆ add() [2/4]

void xtd::drawing::rectangle_f::add ( float  width,
float  height 
)
noexcept

Adds this xtd::drawing::rectangle_f by the specified amount.

Parameters
widthThe amount to add this xtd::drawing::rectangle_f horizontally.
heightThe amount to add this xtd::drawing::rectangle_f verticaly.
Remarks
This method adds this rectangle, not a copy of it.

◆ contains() [1/3]

bool xtd::drawing::rectangle_f::contains ( const point_f pt) const
noexcept

Determines if the specified point is contained within this xtd::drawing::rectangle_f structure.

Parameters
ptThe xtd::drawing::point_f to test.
Returns
This method returns true if the point represented by pt is contained within this xtd::drawing::rectangle_f structure; otherwise false.
Remarks
The containing rectangle must be normalized for this method to return accurate results.

◆ contains() [2/3]

bool xtd::drawing::rectangle_f::contains ( const rectangle_f rect) const
noexcept

Determines if the rectangular region represented by rect is entirely contained within this xtd::drawing::rectangle_f structure.

Parameters
rectThe xtd::drawing::rectangle_f to test.
Returns
This method returns true if the rectangular region represented by rect is entirely contained within this xtd::drawing::rectangle_f structure; otherwise false.
Remarks
The containing rectangle must be normalized for this method to return accurate results.

◆ contains() [3/3]

bool xtd::drawing::rectangle_f::contains ( float  x,
float  y 
) const
noexcept

Determines if the specified point is contained within this xtd::drawing::rectangle_f structure.

Parameters
xThe x-coordinate of the point to test.
yThe y-coordinate of the point to test.
Returns
This method returns true if the point defined by x and y is contained within this xtd::drawing::rectangle_f structure; otherwise false.
Remarks
The containing rectangle must be normalized for this method to return accurate results.

◆ inflate() [1/4]

void xtd::drawing::rectangle_f::inflate ( const drawing::size_f sz)
noexcept

Enlarges this xtd::drawing::rectangle_f by the specified amount.

Parameters
szThe amount to inflate this rectangle.
Remarks
This method enlarges this rectangle, not a copy of it. The rectangle is enlarged in both directions along an axis. For example, if a 50 by 50 rectangle is enlarged by 50 in the x-axis, the resultant rectangle will be 150 units long (the original 50, the 50 in the minus direction, and the 50 in the plus direction) maintaining the rectangle's geometric center.

◆ inflate() [2/4]

void xtd::drawing::rectangle_f::inflate ( float  width,
float  height 
)
noexcept

Enlarges this xtd::drawing::rectangle_f by the specified amount.

Parameters
widthThe amount to inflate this xtd::drawing::rectangle_f horizontally.
heightThe amount to inflate this xtd::drawing::rectangle_f verticaly.
Remarks
This method enlarges this rectangle, not a copy of it. The rectangle is enlarged in both directions along an axis. For example, if a 50 by 50 rectangle is enlarged by 50 in the x-axis, the resultant rectangle will be 150 units long (the original 50, the 50 in the minus direction, and the 50 in the plus direction) maintaining the rectangle's geometric center.
If either x or y is negative, the xtd::drawing::rectangle_f structure is deflated in the corresponding direction.

◆ intersects_with()

bool xtd::drawing::rectangle_f::intersects_with ( const rectangle_f rect) const
noexcept

Determines if this rectangle intersects with rect.

Parameters
rectThe rectangle to test.
Returns
This method returns true if there is any intersection, otherwise false.

◆ make_intersect() [1/2]

void xtd::drawing::rectangle_f::make_intersect ( const rectangle_f rect)
noexcept

Replaces this xtd::drawing::rectangle_f with the intersection of itself and the specified xtd::drawing::rectangle_f.

Parameters
rectThe xtd::drawing::rectangle_f with which to intersect.

◆ make_union() [1/2]

void xtd::drawing::rectangle_f::make_union ( const rectangle_f rect)
noexcept

Replaces this xtd::drawing::rectangle_f with the union of itself and the specified xtd::drawing::rectangle_f.

Parameters
rectThe xtd::drawing::rectangle_f with which to union.

◆ offset() [1/4]

void xtd::drawing::rectangle_f::offset ( const point_f pos)
noexcept

Adjusts the location of this rectangle by the specified amount.

Parameters
posAmount to offset the location.
Remarks
This method adjusts the location of the upper-left corner horizontally by the x-coordinate of the specified point, and vertically by the y-coordinate of the specified point.

◆ offset() [2/4]

void xtd::drawing::rectangle_f::offset ( float  x,
float  y 
)
noexcept

Adjusts the location of this rectangle by the specified amount.

Parameters
xThe horizontal offset.
yThe vertical offset.

◆ to_string()

xtd::string xtd::drawing::rectangle_f::to_string ( ) const
overridevirtualnoexcept

Converts the attributes of this xtd::drawing::rectangle_f to a human-readable string.

Returns
A string that contains the position, width, and height of this Rectangle structure ¾ for example, {x=20, y=20, width=100, height=50}.

Reimplemented from xtd::object.

◆ add() [3/4]

static rectangle_f xtd::drawing::rectangle_f::add ( const rectangle_f rect,
float  x,
float  y 
)
staticnoexcept

Creates and returns an added copy of the specified xtd::drawing::rectangle_f structure. The copy is added by the specified amount. The original xtd::drawing::rectangle_f structure remains unmodified.

Parameters
rectThe xtd::drawing::rectangle_f with which to start. This rectangle is not modified.
xThe amount to add the specified rectangle horizontally.
yThe amount to add the specified rectangle vertically.
Returns
The added xtd::drawing::rectangle_f.
Remarks
This method makes a copy of rect, adds the copy, and then returns the added copy.

◆ add() [4/4]

static rectangle_f xtd::drawing::rectangle_f::add ( const rectangle_f rect,
const drawing::size_f sz 
)
staticnoexcept

Creates and returns an added copy of the specified xtd::drawing::rectangle_f structure. The copy is added by the specified amount. The original xtd::drawing::rectangle_f structure remains unmodified.

Parameters
rectThe xtd::drawing::rectangle_f with which to start. This rectangle is not modified.
szThe amount to add the specified rectangle.
Returns
The added xtd::drawing::rectangle_f.
Remarks
This method makes a copy of rect, adds the copy, and then returns the added copy.

◆ from_ltrb()

static rectangle_f xtd::drawing::rectangle_f::from_ltrb ( float  left,
float  top,
float  right,
float  bottom 
)
staticnoexcept

Creates a xtd::drawing::rectangle_f structure with the specified edge locations.

Parameters
leftThe x-coordinate of the upper-left corner of this xtd::drawing::rectangle_f structure.
topThe y-coordinate of the upper-left corner of this xtd::drawing::rectangle_f structure.
rightThe x-coordinate of the lower-right corner of this xtd::drawing::rectangle_f structure.
bottomThe y-coordinate of the lower-right corner of this xtd::drawing::rectangle_f structure.
Returns
The new xtd::drawing::rectangle_f that this method creates.
Remarks
This method creates a xtd::drawing::rectangle_f with the specified upper-left and lower-right corners.

◆ inflate() [3/4]

static rectangle_f xtd::drawing::rectangle_f::inflate ( const rectangle_f rect,
const drawing::size_f sz 
)
staticnoexcept

Creates and returns an enlarged copy of the specified xtd::drawing::rectangle_f structure. The copy is enlarged by the specified amount. The original xtd::drawing::rectangle_f structure remains unmodified.

Parameters
rectThe xtd::drawing::rectangle_f with which to start. This rectangle is not modified.
xThe amount to inflate the specified rectangle horizontally.
yThe amount to inflate the specified rectangle vertically.
Returns
The enlarged xtd::drawing::rectangle_f.
Remarks
This method makes a copy of rect, enlarges the copy, and then returns the enlarged copy. The rectangle is enlarged in both directions along an axis. For example, if a 50 by 50 rectangle is enlarged by 50 in the x-axis, the resultant rectangle will be 150 units long (the original 50, the 50 in the minus direction, and the 50 in the plus direction) maintaining the rectangle's geometric center.

◆ inflate() [4/4]

static rectangle_f xtd::drawing::rectangle_f::inflate ( const rectangle_f rect,
float  width,
float  height 
)
staticnoexcept

Creates and returns an enlarged copy of the specified xtd::drawing::rectangle_f structure. The copy is enlarged by the specified amount. The original xtd::drawing::rectangle_f structure remains unmodified.

Parameters
rectThe xtd::drawing::rectangle_f with which to start. This rectangle is not modified.
szThe amount to inflate the specified rectangle.
Returns
The enlarged xtd::drawing::rectangle_f.
Remarks
This method makes a copy of rect, enlarges the copy, and then returns the enlarged copy. The rectangle is enlarged in both directions along an axis. For example, if a 50 by 50 rectangle is enlarged by 50 in the x-axis, the resultant rectangle will be 150 units long (the original 50, the 50 in the minus direction, and the 50 in the plus direction) maintaining the rectangle's geometric center.

◆ make_intersect() [2/2]

static rectangle_f xtd::drawing::rectangle_f::make_intersect ( const rectangle_f a,
const rectangle_f b 
)
staticnoexcept

Returns a third xtd::drawing::rectangle_f structure that represents the intersection of two other xtd::drawing::rectangle_f structures. If there is no intersection, an empty xtd::drawing::rectangle_f is returned.

Parameters
aA rectangle to intersect.
bA rectangle to intersect.
Returns
A xtd::drawing::rectangle_f that represents the intersection of a and b.

◆ make_union() [2/2]

static rectangle_f xtd::drawing::rectangle_f::make_union ( const rectangle_f a,
const rectangle_f b 
)
staticnoexcept

Gets a xtd::drawing::rectangle_f structure that contains the union of two xtd::drawing::rectangle_f structures.

Parameters
aA rectangle to union.
bA rectangle to union.
Returns
A xtd::drawing::rectangle_f structure that bounds the union of the two xtd::drawing::rectangle_f structures.

◆ offset() [3/4]

static rectangle_f xtd::drawing::rectangle_f::offset ( const rectangle_f rect,
const point_f pos 
)
staticnoexcept

Creates and returns an offsetted copy of the specified xtd::drawing::rectangle_f structure. The copy is offsetted by the specified amount. The original xtd::drawing::rectangle_f structure remains unmodified.

Parameters
rectThe xtd::drawing::rectangle_f with which to start. This rectangle is not modified.
posThe amount to offset the specified rectangle.
Returns
The offsetted xtd::drawing::rectangle_f.
Remarks
This method makes a copy of rect, offsets the copy, and then returns the offsetted copy.

◆ offset() [4/4]

static rectangle_f xtd::drawing::rectangle_f::offset ( const rectangle_f rect,
float  x,
float  y 
)
staticnoexcept

Creates and returns an offsetted copy of the specified xtd::drawing::rectangle_f structure. The copy is offsetted by the specified amount. The original xtd::drawing::rectangle_f structure remains unmodified.

Parameters
rectThe xtd::drawing::rectangle_f with which to start. This rectangle is not modified.
xThe amount to offset the specified rectangle horizontally.
yThe amount to offset the specified rectangle vertically.
Returns
The offsetted xtd::drawing::rectangle_f.
Remarks
This method makes a copy of rect, offsets the copy, and then returns the offsetted copy.

◆ equals() [1/2]

virtual bool xtd::object::equals ( const object obj) const
virtualnoexcept

Determines whether the specified object is equal to the current object.

Parameters
objThe object to compare with the current object.
Returns
true if the specified object is equal to the current object. otherwise, false.
Examples
The following code example compares the current instance with another object.
#include <xtd/console>
using namespace xtd;
auto main() -> int {
auto object1 = new_ptr<object>();
auto object2 = new_ptr<object>();
auto object3 = object2;
console::write_line(object1->equals(*object3));
console::write_line(*object1 == *object3);
object3 = object1;
console::write_line(object1->equals(*object3));
console::write_line(*object1 == *object3);
}
// This code produces the following output :
//
// false
// false
// true
// true
static void write_line()
Writes the current line terminator to the standard output stream using the specified format informati...
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10

Reimplemented from xtd::object.

◆ equals() [2/2]

template<typename object_a_t , typename object_b_t >
static bool xtd::object::equals ( const object_a_t &  object_a,
const object_b_t &  object_b 
)
inlinestaticnoexcept

Determines whether the specified object instances are considered equal.

Parameters
object_aThe first object to compare.
object_bThe second object to compare.
Returns
true if object_a is the same instance as object_b or if both are null references or if object_a(object_b) returns true. otherwise, false.
Examples
The following code example compares different objects.
#include <xtd/console>
using namespace xtd;
auto main() -> int {
string s1 = "Tom";
string s2 = "Carol";
console::write_line("object::equals(\"{0}\", \"{1}\") => {2}", s1, s2, object::equals(s1, s2));
s1 = "Tom";
s2 = "Tom";
console::write_line("object::equals(\"{0}\", \"{1}\") => {2}", s1, s2, object::equals(s1, s2));
s1 = "";
s2 = "Tom";
console::write_line("object::equals(\"{0}\", \"{1}\") => {2}", s1, s2, object::equals(s1, s2));
s1 = "Carol";
s2 = "";
console::write_line("object::equals(\"{0}\", \"{1}\") => {2}", s1, s2, object::equals(s1, s2));
s1 = "";
s2 = "";
console::write_line("object::equals(\"{0}\", \"{1}\") => {2}", s1, s2, object::equals(s1, s2));
}
// This code produces the following output :
//
// object::equals("Tom", "Carol") => false
// object::equals("Tom", "Tom") => true
// object::equals("", "Tom") => false
// object::equals("Carol", "") => false
// object::equals("", "") => true
virtual bool equals(const object &obj) const noexcept
Determines whether the specified object is equal to the current object.

Member Data Documentation

◆ empty

const rectangle_f xtd::drawing::rectangle_f::empty
static

Represents a xtd::drawing::rectangle_F that has xtd::drawing::rectagle_f::x, xtd::drawing::rectangle_f::y, xtd::drawing::rectangle_f::width and xtd::drawing::rectangle_f::height values set to zero.


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