xtd - Reference Guide 0.2.0
xtd::drawing::size Class Reference

#include <size.h>

Definition

Stores an ordered pair of integers, which specify a height and width.

class drawing_export_ size : public xtd::object
Inheritance
xtd::objectxtd::drawing::size
Namespace
xtd::drawing
Library
xtd.drawing
Examples:
colored_tab_pages.cpp, settings_example.cpp, and user_control.cpp.

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. More...
 

Constructors

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

Properties

int32_t height () const noexcept
 Gets he vertical component of this xtd::drawing::size class. More...
 
void height (int32_t value) noexcept
 Sets the vertical component of this xtd::drawing::size class. More...
 
bool is_empty () const noexcept
 Tests whether this xtd::drawing::size class has xtd::drawing::size_fwidth and xtd::drawing::size_fheight of 0. More...
 
int32_t width () const noexcept
 Gets the horizontal component of this xtd::drawing::size class. More...
 
void width (int32_t value) noexcept
 Sets the horizontal component of this xtd::drawing::size class. More...
 

Methods

xtd::ustring to_string () const noexcept override
 Creates a human-readable string that represents this xtd::drawing::size class. More...
 
static size add (const size &size1, const size &size2) noexcept
 Adds the width and height of one xtd::drawing::size class to the width and height of another size class. More...
 
static size ceiling (const size_f &value) noexcept
 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. More...
 
static size round (const size_f &value) noexcept
 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. More...
 
static xtd::drawing::size subtract (const xtd::drawing::size &sz1, const xtd::drawing::size &sz2) noexcept
 Returns the result of subtracting specified xtd::drawing::size from the specified xtd::drawing::size. More...
 
static size truncate (const size_f &value) noexcept
 Converts the specified xtd::drawing::size_f to a xtd::drawing::size by truncating the values of the xtd::drawing::size_f. More...
 

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...
 

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 ( int32_t  width,
int32_t  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

◆ add()

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

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

static size xtd::drawing::size::ceiling ( const size_f value)
staticnoexcept

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.

◆ height() [1/2]

int32_t xtd::drawing::size::height ( ) const
noexcept

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

Returns
The 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.
Examples:
screen.cpp.

◆ height() [2/2]

void xtd::drawing::size::height ( int32_t  value)
noexcept

Sets the vertical component of this xtd::drawing::size class.

Parameters
valueThe 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.

◆ is_empty()

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

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.

◆ round()

static size xtd::drawing::size::round ( const size_f value)
staticnoexcept

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

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

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.

◆ to_string()

xtd::ustring xtd::drawing::size::to_string ( ) const
overridevirtualnoexcept

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

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

Reimplemented from xtd::object.

◆ truncate()

static size xtd::drawing::size::truncate ( const size_f value)
staticnoexcept

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.

◆ width() [1/2]

int32_t xtd::drawing::size::width ( ) const
noexcept

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

Returns
int The 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.
Examples:
screen.cpp.

◆ width() [2/2]

void xtd::drawing::size::width ( int32_t  value)
noexcept

Sets the horizontal component of this xtd::drawing::size class.

Parameters
valueThe 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.

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.


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