xtd 1.0.0
Loading...
Searching...
No Matches
xtd::drawing::size_f Struct Reference
Inheritance diagram for xtd::drawing::size_f:
xtd::object xtd::icomparable< size_f > xtd::iequatable< size_f > xtd::interface xtd::extensions::comparison_operators< size_f, icomparable< size_f > > xtd::interface xtd::extensions::equality_operators< size_f, iequatable< size_f > >

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:45
#define drawing_export_
Define shared library export.
Definition drawing_export.hpp:13
size_f() noexcept=default
Initializes a new instance of the Size class that has a Height and Width value of 0.
Inheritance
xtd::objectxtd::drawing::size_f
Namespace
xtd::drawing
Library
xtd.drawing

Public Fields

static const 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.
auto is_empty () const noexcept -> bool
 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

auto compare_to (const size_f &obj) const noexcept -> xtd::int32 override
 Compares the current instance with another object of the same type.
auto equals (const xtd::object &obj) const noexcept -> bool override
 Determines whether the specified object is equal to the current object.
auto equals (const size_f &other) const noexcept -> bool override
 Determines whether the specified object is equal to the current object.
auto get_hash_code () const noexcept -> xtd::usize override
 Serves as a hash function for a particular type.
auto to_string () const noexcept -> xtd::string override
 Creates a human-readable string that represents this xtd::drawing::size_f class.

Operators

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

Public Static Methods

static auto add (const size_f &size1, const size_f &size2) noexcept -> size_f
 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 auto subtract (const size_f &sz1, const size_f &sz2) noexcept -> size_f
 Returns the result of subtracting specified xtd::drawing::size_f from the specified xtd::drawing::size_f.

Additional Inherited Members

 object ()=default
 Create a new instance of the ultimate base class object.
virtual auto get_type () const noexcept -> type_object
 Gets the type of the current instance.
template<typename object_t>
auto memberwise_clone () const -> xtd::unique_ptr_object< object_t >
 Creates a shallow copy of the current object.
virtual auto compare_to (const size_f &obj) const noexcept -> xtd::int32=0
 Compares the current instance with another object of the same type.
virtual auto equals (const size_f &) const noexcept -> bool=0
 Indicates whether the current object is equal to another object of the same type.
template<typename object_a_t, typename object_b_t>
static auto equals (const object_a_t &object_a, const object_b_t &object_b) noexcept -> bool
 Determines whether the specified object instances are considered equal.
template<typename object_a_t, typename object_b_t>
static auto reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept -> bool
 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()

auto xtd::drawing::size_f::is_empty ( ) const -> bool
nodiscardnoexcept

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.

◆ compare_to()

auto xtd::drawing::size_f::compare_to ( const size_f & obj) const -> xtd::int32
nodiscardoverridenoexcept

Compares the current instance with another object of the same type.

Parameters
objAn object to compare with this instance.
Returns
A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has these meanings:
Value Condition
Less than zero This instance is less than obj.
Zero This instance is equal to obj.
Greater than zero This instance is greater than obj.

◆ equals() [1/2]

auto xtd::drawing::size_f::equals ( const xtd::object & obj) const -> bool
nodiscardoverridevirtualnoexcept

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]

auto xtd::drawing::size_f::equals ( const size_f & other) const -> bool
nodiscardoverridenoexcept

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()

auto xtd::drawing::size_f::get_hash_code ( ) const -> xtd::usize
nodiscardoverridevirtualnoexcept

Serves as a hash function for a particular type.

Returns
A hash code for the current object.

Reimplemented from xtd::object.

◆ to_string()

auto xtd::drawing::size_f::to_string ( ) const -> xtd::string
nodiscardoverridevirtualnoexcept

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()

auto xtd::drawing::size_f::add ( const size_f & size1,
const size_f & size2 ) -> size_f
staticnodiscardnoexcept

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()

auto xtd::drawing::size_f::subtract ( const size_f & sz1,
const size_f & sz2 ) -> size_f
staticnodiscardnoexcept

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]

auto xtd::drawing::size_f::operator+ ( const xtd::drawing::size_f & size) const -> size_f
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]

auto xtd::drawing::size_f::operator+ ( const xtd::drawing::size & size) const -> size_f
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]

auto xtd::drawing::size_f::operator+= ( const xtd::drawing::size_f & size) -> size_f &
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]

auto xtd::drawing::size_f::operator+= ( const xtd::drawing::size & size) -> size_f &
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]

auto xtd::drawing::size_f::operator- ( const xtd::drawing::size_f & size) const -> size_f
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]

auto xtd::drawing::size_f::operator- ( const xtd::drawing::size & size) const -> size_f
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]

auto xtd::drawing::size_f::operator-= ( const xtd::drawing::size_f & size) -> size_f &
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]

auto xtd::drawing::size_f::operator-= ( const xtd::drawing::size & size) -> size_f &
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 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: