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

Definition

Stores an ordered pair of integers, 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()=default
Initializes a new instance of the xtd::drawing::size class that has a Height and Width value of 0.
Inheritance
xtd::objectxtd::drawing::size
Namespace
xtd::drawing
Library
xtd.drawing
Examples
image_effects.cpp, point.cpp, and tutorial_button.cpp.

Public Fields

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

Public Properties

xtd::int32 width
 Gets or sets the horizontal component of this xtd::drawing::size class.
xtd::int32 height
 Gets or sets he vertical component of this xtd::drawing::size class.
auto is_empty () const noexcept -> bool
 Tests whether this xtd::drawing::size class has xtd::drawing::size_fwidth and xtd::drawing::size_fheight of 0.

Public Constructors

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

Public Methods

auto compare_to (const xtd::drawing::size &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 xtd::drawing::size &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 class.

Operators

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

Public Static Methods

static auto add (const size &size1, const size &size2) noexcept -> size
 Adds the width and height of one xtd::drawing::size class to the width and height of another size class.
static auto ceiling (const xtd::drawing::size_f &value) noexcept -> size
 Converts the specified xtd::drawing::size_f to a xtd::drawing::size by rounding the values of the xtd::drawing::size_f to the next higher integer values.
static auto round (const xtd::drawing::size_f &value) noexcept -> size
 Converts the specified xtd::drawing::size_f to a xtd::drawing::size object by rounding the xtd::drawing::size_f values to the nearest integer.
static auto subtract (const size &sz1, const size &sz2) noexcept -> size
 Returns the result of subtracting specified xtd::drawing::size from the specified xtd::drawing::size.
static auto truncate (const xtd::drawing::size_f &value) noexcept -> size
 Converts the specified xtd::drawing::size_f to a xtd::drawing::size by truncating the values of the 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 &obj) const noexcept -> xtd::int32=0
 Compares the current instance with another object of the same type.
virtual auto equals (const size &) 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() [1/3]

xtd::drawing::size::size ( )
default

Initializes a new instance of the xtd::drawing::size class that has a Height and Width value of 0.

◆ size() [2/3]

xtd::drawing::size::size ( const xtd::drawing::point & point)
explicitnoexcept

Initializes a new instance of the xtd::drawing::size class from the specified xtd::drawing::point class.

Parameters
pointThe xtd::drawing::point class from which to initialize this xtd::drawing::size class

◆ size() [3/3]

xtd::drawing::size::size ( xtd::int32 width,
xtd::int32 height )
noexcept

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

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

Member Function Documentation

◆ is_empty()

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

Tests whether this xtd::drawing::size class has xtd::drawing::size_fwidth and xtd::drawing::size_fheight of 0.

Returns
Returns true when this xtd::drawing::size class has both a xtd::drawing::size::width and xtd::drawing::size::height of 0; otherwise, false.

◆ compare_to()

auto xtd::drawing::size::compare_to ( const xtd::drawing::size & 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::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::equals ( const xtd::drawing::size & 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::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::to_string ( ) const -> xtd::string
nodiscardoverridevirtualnoexcept

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

Returns
A xtd::string that represents this xtd::drawing::size.

Reimplemented from xtd::object.

◆ add()

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

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

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

◆ ceiling()

auto xtd::drawing::size::ceiling ( const xtd::drawing::size_f & value) -> size
staticnodiscardnoexcept

Converts the specified xtd::drawing::size_f to a xtd::drawing::size by rounding the values of the xtd::drawing::size_f to the next higher integer values.

Parameters
valueThe xtd::drawing::size_f to convert.
Returns
The xtd::drawing::size this method converts to.

◆ round()

auto xtd::drawing::size::round ( const xtd::drawing::size_f & value) -> size
staticnodiscardnoexcept

Converts the specified xtd::drawing::size_f to a xtd::drawing::size object by rounding the xtd::drawing::size_f values to the nearest integer.

Parameters
valueThe xtd::drawing::size_f to convert.
Returns
The xtd::drawing::size this method converts to.

◆ subtract()

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

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

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

◆ truncate()

auto xtd::drawing::size::truncate ( const xtd::drawing::size_f & value) -> size
staticnodiscardnoexcept

Converts the specified xtd::drawing::size_f to a xtd::drawing::size by truncating the values of the xtd::drawing::size_f.

Parameters
valueThe xtd::drawing::size_f to convert.
Returns
The xtd::drawing::size this method converts to.

◆ operator+()

auto xtd::drawing::size::operator+ ( const size & size) const -> xtd::drawing::size
noexcept

Increases a xtd::drawing::size 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.
Returns
The increased xtd::drawing::size.

◆ operator+=()

auto xtd::drawing::size::operator+= ( const size & size) -> xtd::drawing::size &
noexcept

Increases a xtd::drawing::size 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.
Returns
The increased xtd::drawing::size.

◆ operator-()

auto xtd::drawing::size::operator- ( const size & size) const -> xtd::drawing::size
noexcept

Decreases a xtd::drawing::size 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.
Returns
The decreased xtd::drawing::size.

◆ operator-=()

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

Decreases a xtd::drawing::size 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.
Returns
The decreased xtd::drawing::size.

Member Data Documentation

◆ empty

const xtd::drawing::size xtd::drawing::size::empty
static

Gets a xtd::drawing::size class that has a Height and Width value of 0. This field is constant.

◆ width

xtd::int32 xtd::drawing::size::width

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

Parameters
widthThe horizontal component of this xtd::drawing::size class, typically measured in pixels.
Remarks
The unit for the xtd::drawing::size::height and xtd::drawing::size::width of the xtd::drawing::size 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

xtd::int32 xtd::drawing::size::height

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

Parameters
heightThe vertical component of this xtd::drawing::size class, typically measured in pixels.
Remarks
The unit for the xtd::drawing::size::height and xtd::drawing::size::width of the xtd::drawing::size 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:
  • xtd.drawing/include/xtd/drawing/size.hpp