8#include "../drawing_export.h"
40 size(int32_t width, int32_t height) : width_(width), height_(height) {}
44 bool operator==(
const xtd::drawing::size& value)
const {
return width_ == value.width_ && height_ == value.height_;}
51 operator size_f() {
return size_f(
static_cast<float>(width_),
static_cast<float>(height_));}
57 int32_t
height()
const {
return height_;}
67 int32_t
width()
const {
return width_;}
87 bool is_empty()
const {
return *
this == size::empty;}
103 xtd::ustring to_string() const noexcept
override {
return "{width=" + std::to_string(width_) +
", height=" + std::to_string(height_) +
"}";}
123 inline drawing::size parse<drawing::size>(
const std::string& str) {
125 return {xtd::parse<int32_t>(values[0]), xtd::parse<int32_t>(values[1])};
Represents an ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional ...
Definition: point.h:48
Stores an ordered pair of floating-point, which specify a height and width.
Definition: size_f.h:24
Stores an ordered pair of integers, which specify a height and width.
Definition: size.h:25
size(int32_t width, int32_t height)
Initializes a new instance of the Size class from the specified dimensions.
Definition: size.h:40
size()=default
Initializes a new instance of the Size class that has a Height and Width value of 0.
static size round(const size_f &value)
Converts the specified size_f to a size object by rounding the size_f values to the nearest integer.
void height(int32_t height)
Sets the vertical component of this Size Class.
Definition: size.h:62
int32_t width() const
Gets the horizontal component of this Size class.
Definition: size.h:67
static size truncate(const size_f &value)
Converts the specified size_f to a size by truncating the values of the size_f.
static const xtd::drawing::size empty
Gets a Size class that has a Height and Width value of 0. This field is constant.
Definition: size.h:28
int32_t height() const
Gets he vertical component of this Size Class.
Definition: size.h:57
xtd::ustring to_string() const noexcept override
Creates a human-readable string that represents this size class.
Definition: size.h:103
void width(int32_t width)
Sets the horizontal component of this Size class.
Definition: size.h:72
static size ceiling(const size_f &value)
Converts the specified size_f to a size by rounding the values of the size_f to the next higher integ...
bool is_empty() const
Tests whether this Size class has width and height of 0.
Definition: size.h:87
static xtd::drawing::size subtract(const xtd::drawing::size &sz1, const xtd::drawing::size &sz2)
Returns the result of subtracting specified size from the specified size.
size(const xtd::drawing::point &point)
IInitializes a new instance of the Size class from the specified Point class.
static size add(const size &size1, const size &size2)
Adds the width and height of one Size class to the width and height of another size class.
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition: object.h:26
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:48
std::vector< ustring > split(const std::vector< value_type > &separators, size_t count, string_split_options options) const noexcept
Splits this string into a maximum number of substrings based on the characters in an array.
ustring replace(value_type old_char, value_type new_char) const noexcept
Replaces all occurrences of a specified char_t in this string with another specified char_t.
#define drawing_export_
Define shared library export.
Definition: drawing_export.h:13
@ point
Specifies a printer's point (1/72 inch) as the unit of measure.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition: system_report.h:17
Contains xtd::object class.
Contains xtd::drawing::size_f class.
Contains xtd::ustring class.