xtd 0.2.0
xtd::drawing::size_f Struct Reference
Inheritance diagram for xtd::drawing::size_f:
xtd::object xtd::iequatable< size_f > xtd::interface xtd::extensions::equality_operators< type_t, equatable_t >

Definition

Stores an ordered pair of floating-point, which specify a height and width.

Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:43
#define drawing_export_
Define shared library export.
Definition drawing_export.hpp:13
Stores an ordered pair of floating-point, which specify a height and width.
Definition size_f.hpp:31
Inheritance
xtd::objectxtd::drawing::size_f
Namespace
xtd::drawing
Library
xtd.drawing

Public Fields

static const xtd::drawing::size_f empty
 Gets a Size class that has a Height and Width value of 0. This field is constant.
 

Public Properties

float width
 Gets or sets the horizontal component of this xtd::drawing::size_f class.
 
float height
 Gets or sets he vertical component of this xtd::drawing::size_f class.
 
bool is_empty () const noexcept
 Tests whether this Size class has xtd::drawing::size_f::width and xtd::drawing::size_f::height of 0.
 

Public Constructors

 size_f () noexcept=default
 Initializes a new instance of the Size class that has a Height and Width value of 0.
 
 size_f (const xtd::drawing::point_f &point) noexcept
 Initializes a new instance of the xtd::drawing::size_f class from the specified xtd::drawing::point_f class.
 
 size_f (float width, float height) noexcept
 Initializes a new instance of the xtd::drawing::size_f class from the specified dimensions.
 

Public Methods

bool equals (const xtd::object &obj) const noexcept override
 Determines whether the specified object is equal to the current object.
 
bool equals (const xtd::drawing::size_f &other) const noexcept override
 Determines whether the specified object is equal to the current object.
 
xtd::size get_hash_code () const noexcept override
 Serves as a hash function for a particular type.
 
xtd::string to_string () const noexcept override
 Creates a human-readable string that represents this xtd::drawing::size_f class.
 

Operators

size_f operator+ (const xtd::drawing::size_f &size) const noexcept
 Increases a xtd::drawing::size_f with a given xtd::drawing::size_f.
 
size_f operator+ (const xtd::drawing::size &size) const noexcept
 Increases a xtd::drawing::size_f with a given xtd::drawing::size.
 
size_foperator+= (const xtd::drawing::size_f &size) noexcept
 Increases a xtd::drawing::size_f wuth a given xtd::drawing::size_f.
 
size_foperator+= (const xtd::drawing::size &size) noexcept
 Increases a xtd::drawing::size_f wuth a given xtd::drawing::size.
 
size_f operator- (const xtd::drawing::size_f &size) const noexcept
 Decreases a xtd::drawing::size_f with the a given xtd::drawing::size_f.
 
size_f operator- (const xtd::drawing::size &size) const noexcept
 Decreases a xtd::drawing::size_f with the a given xtd::drawing::size.
 
size_foperator-= (const xtd::drawing::size_f &size) noexcept
 Decreases a xtd::drawing::size_f with the a given xtd::drawing::size_f.
 
size_foperator-= (const xtd::drawing::size &size) noexcept
 Decreases a xtd::drawing::size_f with the a given xtd::drawing::size.
 

Public Static Methods

static xtd::drawing::size_f add (const xtd::drawing::size_f &size1, const xtd::drawing::size_f &size2) noexcept
 Adds the width and height of one xtd::drawing::size_f class to the width and height of another xtd::drawing::size_f class.
 
static xtd::drawing::size_f subtract (const xtd::drawing::size_f &sz1, const xtd::drawing::size_f &sz2) noexcept
 Returns the result of subtracting specified xtd::drawing::size_f from the specified xtd::drawing::size_f.
 

Additional Inherited Members

- Public Member Functions inherited from xtd::object
 object ()=default
 Create a new instance of the ultimate base class object.
 
virtual type_object get_type () const noexcept
 Gets the type of the current instance.
 
template<class object_t >
xtd::uptr< object_t > memberwise_clone () const
 Creates a shallow copy of the current object.
 
- Public Member Functions inherited from xtd::iequatable< size_f >
virtual bool equals (const size_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<class object_a_t , class 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<class object_a_t , class 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

◆ size_f() [1/3]

xtd::drawing::size_f::size_f ( )
defaultnoexcept

Initializes a new instance of the Size class that has a Height and Width value of 0.

◆ size_f() [2/3]

xtd::drawing::size_f::size_f ( const xtd::drawing::point_f point)
explicitnoexcept

Initializes a new instance of the xtd::drawing::size_f class from the specified xtd::drawing::point_f class.

Parameters
pointThe xtd::drawing::point_f class from which to initialize this xtd::drawing::size_f class

◆ size_f() [3/3]

xtd::drawing::size_f::size_f ( float  width,
float  height 
)
noexcept

Initializes a new instance of the xtd::drawing::size_f class from the specified dimensions.

Parameters
widthThe width component of the new xtd::drawing::size_f.
heightThe height component of the new xtd::drawing::size_f.

Member Function Documentation

◆ is_empty()

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

Tests whether this Size class has xtd::drawing::size_f::width and xtd::drawing::size_f::height of 0.

Returns
Returns true when this xtd::drawing::size_f class has both a xtd::drawing::size_fwidth and xtd::drawing::size_fheight of 0; otherwise, false.

◆ equals() [1/2]

bool xtd::drawing::size_f::equals ( const xtd::object obj) const
overridevirtualnoexcept

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.

Reimplemented from xtd::object.

◆ equals() [2/2]

bool xtd::drawing::size_f::equals ( const xtd::drawing::size_f other) const
overridenoexcept

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

Parameters
otherThe object to compare with the current object.
Returns
true if the specified object is equal to the current object. otherwise, false.

◆ get_hash_code()

xtd::size xtd::drawing::size_f::get_hash_code ( ) const
overridevirtualnoexcept

Serves as a hash function for a particular type.

Returns
A hash code for the current object.

Reimplemented from xtd::object.

◆ to_string()

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

Creates a human-readable string that represents this xtd::drawing::size_f class.

Returns
A xtd::string that represents this size.

Reimplemented from xtd::object.

◆ add()

static xtd::drawing::size_f xtd::drawing::size_f::add ( const xtd::drawing::size_f size1,
const xtd::drawing::size_f size2 
)
staticnoexcept

Adds the width and height of one xtd::drawing::size_f class to the width and height of another xtd::drawing::size_f class.

Parameters
size1The first xtd::drawing::size_f class to add.
size2The second xtd::drawing::size_f class to add.
Returns
A xtd::drawing::size_f class that is the result of the addition operation.

◆ subtract()

static xtd::drawing::size_f xtd::drawing::size_f::subtract ( const xtd::drawing::size_f sz1,
const xtd::drawing::size_f sz2 
)
staticnoexcept

Returns the result of subtracting specified xtd::drawing::size_f from the specified xtd::drawing::size_f.

Parameters
sz1The xtd::drawing::size_f to be subtracted from.
sz2The xtd::drawing::size_f to subtract from the Size.
Returns
The xtd::drawing::size_f that is the result of the subtraction operation.

◆ operator+() [1/2]

size_f xtd::drawing::size_f::operator+ ( const xtd::drawing::size_f size) const
noexcept

Increases a xtd::drawing::size_f with a given xtd::drawing::size_f.

Parameters
sizeA xtd::drawing::size_f that specifies the pair of numbers to add to the size of this xtd::drawing::size_f.
Returns
The increased xtd::drawing::size.

◆ operator+() [2/2]

size_f xtd::drawing::size_f::operator+ ( const xtd::drawing::size size) const
noexcept

Increases a xtd::drawing::size_f with a given xtd::drawing::size.

Parameters
sizeA xtd::drawing::size that specifies the pair of numbers to add to the size of this xtd::drawing::size_f.
Returns
The increased xtd::drawing::size_f.

◆ operator+=() [1/2]

size_f & xtd::drawing::size_f::operator+= ( const xtd::drawing::size_f size)
noexcept

Increases a xtd::drawing::size_f wuth a given xtd::drawing::size_f.

Parameters
sizeA xtd::drawing::size_f that specifies the pair of numbers to add to the size of this xtd::drawing::size_f.
Returns
The increased xtd::drawing::size_f.

◆ operator+=() [2/2]

size_f & xtd::drawing::size_f::operator+= ( const xtd::drawing::size size)
noexcept

Increases a xtd::drawing::size_f wuth a given xtd::drawing::size.

Parameters
sizeA xtd::drawing::size that specifies the pair of numbers to add to the size of this xtd::drawing::size_f.
Returns
The increased xtd::drawing::size_f.

◆ operator-() [1/2]

size_f xtd::drawing::size_f::operator- ( const xtd::drawing::size_f size) const
noexcept

Decreases a xtd::drawing::size_f with the a given xtd::drawing::size_f.

Parameters
sizeA xtd::drawing::size_f that specifies the pair of numbers to subtract from the size of this xtd::drawing::size_f.
Returns
The decreased xtd::drawing::size_f.

◆ operator-() [2/2]

size_f xtd::drawing::size_f::operator- ( const xtd::drawing::size size) const
noexcept

Decreases a xtd::drawing::size_f with the a given xtd::drawing::size.

Parameters
sizeA xtd::drawing::size that specifies the pair of numbers to subtract from the size of this xtd::drawing::size_f.
Returns
The decreased xtd::drawing::size_f.

◆ operator-=() [1/2]

size_f & xtd::drawing::size_f::operator-= ( const xtd::drawing::size_f size)
noexcept

Decreases a xtd::drawing::size_f with the a given xtd::drawing::size_f.

Parameters
sizeA xtd::drawing::size_f that specifies the pair of numbers to subtract from the size of this xtd::drawing::size_f.
Returns
The decreased xtd::drawing::size_f.

◆ operator-=() [2/2]

size_f & xtd::drawing::size_f::operator-= ( const xtd::drawing::size size)
noexcept

Decreases a xtd::drawing::size_f with the a given xtd::drawing::size.

Parameters
sizeA xtd::drawing::size that specifies the pair of numbers to subtract from the size of this xtd::drawing::size_f.
Returns
The decreased xtd::drawing::size_f.

Member Data Documentation

◆ empty

const xtd::drawing::size_f xtd::drawing::size_f::empty
static

Gets a Size class that has a Height and Width value of 0. This field is constant.

◆ width

float xtd::drawing::size_f::width

Gets or sets the horizontal component of this xtd::drawing::size_f class.

Parameters
widthThe horizontal component of this xtd::drawing::size_f class, typically measured in pixels.
Remarks
The unit for the xtd::drawing::size_f::height and xtd::drawing::size_f::width of the xtd::drawing::size_f class depend on the xtd::drawing::graphics::page_unit and xtd::drawing::graphics::page_scale settings for the xtd::drawing::graphics object that is used to draw.

◆ height

float xtd::drawing::size_f::height

Gets or sets he vertical component of this xtd::drawing::size_f class.

Parameters
heightThe vertical component of this xtd::drawing::size_f class, typically measured in pixels.
Remarks
The unit for the xtd::drawing::size_f::height and xtd::drawing::size_f::width of the xtd::drawing::size_f class depend on the xtd::drawing::graphics::page_unit and xtd::drawing::graphics::page_scale settings for the xtd::drawing::graphics object that is used to draw.

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