xtd - Reference Guide  0.2.0
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
Static Public Attributes | Public Member Functions | Static Public Member Functions | List of all members
xtd::drawing::size_f Class Reference

#include <size_f.h>

Definition

Stores an ordered pair of floating-point, which specify a height and width.

Namespace
xtd::drawing
Library
xtd.drawing

Static Public Attributes

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

Public Member Functions

 size_f ()=default
 Initializes a new instance of the Size class that has a Height and Width value of 0. More...
 
 size_f (const xtd::drawing::point_f &point)
 Initializes a new instance of the Size class from the specified Point class. More...
 
 size_f (float width, float height)
 Initializes a new instance of the Size class from the specified dimensions. More...
 
float height () const
 Gets he vertical component of this Size Class. More...
 
void height (float height)
 Sets the vertical component of this Size Class. More...
 
bool is_empty () const
 Tests whether this Size class has width and height of 0. More...
 
xtd::ustring to_string () const noexcept override
 Creates a human-readable string that represents this size class. More...
 
float width () const
 Gets the horizontal component of this Size class. More...
 
void width (float width)
 Sets the horizontal component of this Size class. More...
 
- 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

static xtd::drawing::size_f add (const xtd::drawing::size_f &size1, const xtd::drawing::size_f &size2)
 Adds the width and height of one Size class to the width and height of another size class. More...
 
static xtd::drawing::size_f subtract (const xtd::drawing::size_f &sz1, const xtd::drawing::size_f &sz2)
 Returns the result of subtracting specified size from the specified size. 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_f() [1/3]

xtd::drawing::size_f::size_f ( )
default

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

Initializes a new instance of the Size class from the specified Point class.

Parameters
pointThe Point class from which to initialize this Size class

◆ size_f() [3/3]

xtd::drawing::size_f::size_f ( float  width,
float  height 
)
inline

Initializes a new instance of the Size class from the specified dimensions.

Parameters
widthThe width component of the new Size
heightThe height component of the new Size

Member Function Documentation

◆ add()

static xtd::drawing::size_f xtd::drawing::size_f::add ( const xtd::drawing::size_f size1,
const xtd::drawing::size_f size2 
)
static

Adds the width and height of one Size class to the width and height of another size class.

Parameters
size1The first Size class to add.
size2The second Size class to add.
Returns
Size A Size class that is the result of the addition operation.

◆ height() [1/2]

float xtd::drawing::size_f::height ( ) const
inline

Gets he vertical component of this Size Class.

Returns
int The vertical component of this Size class, typically measured in pixels.
Remarks
The unit for the Height and Width of the Size class depend on the PageUnit and PageScale settings for the Graphics object that is used to draw.
Examples:
user_control.cpp.

◆ height() [2/2]

void xtd::drawing::size_f::height ( float  height)
inline

Sets the vertical component of this Size Class.

Returns
int The vertical component of this Size class, typically measured in pixels.
Remarks
The unit for the Height and Width of the Size class depend on the PageUnit and PageScale settings for the Graphics object that is used to draw.

◆ is_empty()

bool xtd::drawing::size_f::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.

◆ subtract()

static xtd::drawing::size_f xtd::drawing::size_f::subtract ( const xtd::drawing::size_f sz1,
const xtd::drawing::size_f sz2 
)
static

Returns the result of subtracting specified size from the specified size.

Parameters
sz1The Size to be subtracted from.
sz2The Size to subtract from the Size.
Returns
The Size that is the result of the subtraction operation.
Exceptions
ArgumentNullExceptionsz1 or sz2 are null.

◆ to_string()

xtd::ustring xtd::drawing::size_f::to_string ( ) const
inlineoverridevirtualnoexcept

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

Returns
string A string that represents this size.

Reimplemented from xtd::object.

◆ width() [1/2]

float xtd::drawing::size_f::width ( ) const
inline

Gets the horizontal component of this Size class.

Returns
int The horizontal component of this Size class, typically measured in pixels.
Remarks
The unit for the Height and Width of the Size class depend on the PageUnit and PageScale settings for the Graphics object that is used to draw.

◆ width() [2/2]

void xtd::drawing::size_f::width ( float  width)
inline

Sets the horizontal component of this Size class.

Returns
int The horizontal component of this Size class, typically measured in pixels.
Remarks
The unit for the Height and Width of the Size class depend on the PageUnit and PageScale settings for the Graphics object that is used to draw.

Member Data Documentation

◆ empty

const xtd::drawing::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.


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