#include <size.h>
Stores an ordered pair of integers, which specify a height and width.
- Namespace
- xtd::drawing
- Library
- xtd.drawing
- Examples
- settings_example.cpp, and user_control.cpp.
Inherits xtd::object.
|
static const xtd::drawing::size | empty |
| Gets a Size class that has a Height and Width value of 0. This field is constant.
|
|
|
| size ()=default |
| Initializes a new instance of the Size class that has a Height and Width value of 0.
|
|
| size (const xtd::drawing::point &point) |
| IInitializes a new instance of the Size class from the specified Point class.
|
|
| size (int32_t width, int32_t height) |
| Initializes a new instance of the Size class from the specified dimensions.
|
|
int32_t | height () const |
| Gets he vertical component of this Size Class.
|
|
void | height (int32_t height) |
| Sets the vertical component of this Size Class.
|
|
bool | is_empty () const |
| Tests whether this Size class has width and height of 0.
|
|
xtd::ustring | to_string () const noexcept override |
| Creates a human-readable string that represents this size class.
|
|
int32_t | width () const |
| Gets the horizontal component of this Size class.
|
|
void | width (int32_t width) |
| Sets the horizontal component of this Size class.
|
|
| object ()=default |
| Create a new instance of the ultimate base class object.
|
|
virtual bool | equals (const object &obj) const noexcept |
| Determines whether the specified object is equal to the current object.
|
|
virtual size_t | get_hash_code () const noexcept |
| Serves as a hash function for a particular type.
|
|
template<typename object_t > |
std::unique_ptr< object_t > | memberwise_clone () const |
| Gets the type of the current instance.
|
|
virtual xtd::ustring | to_string () const noexcept |
| Returns a std::string that represents the current object.
|
|
◆ size() [1/3]
xtd::drawing::size::size |
( |
| ) |
|
|
default |
Initializes a new instance of the Size class that has a Height and Width value of 0.
◆ size() [2/3]
IInitializes a new instance of the Size class from the specified Point class.
- Parameters
-
point | The Point class from which to initialize this Size class |
◆ size() [3/3]
xtd::drawing::size::size |
( |
int32_t |
width, |
|
|
int32_t |
height |
|
) |
| |
|
inline |
Initializes a new instance of the Size class from the specified dimensions.
- Parameters
-
width | The width component of the new Size |
height | The height component of the new Size |
◆ add()
static size xtd::drawing::size::add |
( |
const size & |
size1, |
|
|
const size & |
size2 |
|
) |
| |
|
static |
Adds the width and height of one Size class to the width and height of another size class.
- Parameters
-
size1 | The first Size class to add. |
size2 | The second Size class to add. |
- Returns
- Size A Size class that is the result of the addition operation.
◆ ceiling()
static size xtd::drawing::size::ceiling |
( |
const size_f & |
value | ) |
|
|
static |
Converts the specified size_f to a size by rounding the values of the size_f to the next higher integer values.
- Parameters
-
- Returns
- The size this method converts to.
◆ height() [1/2]
int32_t xtd::drawing::size::height |
( |
| ) |
const |
|
inline |
Gets he vertical component of this Size Class.
- Returns
- int The vertical component of this Size class, typically measured in pixels.
- Examples
- screen.cpp.
◆ height() [2/2]
void xtd::drawing::size::height |
( |
int32_t |
height | ) |
|
|
inline |
Sets the vertical component of this Size Class.
- Returns
- int The vertical component of this Size class, typically measured in pixels.
◆ is_empty()
bool xtd::drawing::size::is_empty |
( |
| ) |
const |
|
inline |
Tests whether this Size class has width and height of 0.
- Returns
- bool Returns true when this Size class has both a width and height of 0; otherwise, false.
◆ round()
static size xtd::drawing::size::round |
( |
const size_f & |
value | ) |
|
|
static |
Converts the specified size_f to a size object by rounding the size_f values to the nearest integer.
- Parameters
-
- Returns
- The size this method converts to.
◆ subtract()
Returns the result of subtracting specified size from the specified size.
- Parameters
-
sz1 | The Size to be subtracted from. |
sz2 | The Size to subtract from the Size. |
- Returns
- The Size that is the result of the subtraction operation.
- Exceptions
-
ArgumentNullException | sz1 or sz2 are null. |
◆ to_string()
|
inlineoverridevirtualnoexcept |
Creates a human-readable string that represents this size class.
- Returns
- string A string that represents this size.
Reimplemented from xtd::object.
◆ truncate()
static size xtd::drawing::size::truncate |
( |
const size_f & |
value | ) |
|
|
static |
Converts the specified size_f to a size by truncating the values of the size_f.
- Parameters
-
- Returns
- The size this method converts to.
◆ width() [1/2]
int32_t xtd::drawing::size::width |
( |
| ) |
const |
|
inline |
Gets the horizontal component of this Size class.
- Returns
- int The horizontal component of this Size class, typically measured in pixels.
- Examples
- screen.cpp.
◆ width() [2/2]
void xtd::drawing::size::width |
( |
int32_t |
width | ) |
|
|
inline |
Sets the horizontal component of this Size class.
- Returns
- int The horizontal component of this Size class, typically measured in pixels.
◆ empty
Gets a 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:
- xtd.drawing/include/xtd/drawing/size.h