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

#include <size_f.h>

Definition

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

class drawing_export_ size_f : public xtd::object
Inheritance
xtd::objectxtd::drawing::size_f
Namespace
xtd::drawing
Library
xtd.drawing

Fields

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

Constructors

 size_f () noexcept=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) noexcept
 Initializes a new instance of the xtd::drawing::size_f class from the specified xtd::drawing::point_f class. More...
 
 size_f (float width, float height) noexcept
 Initializes a new instance of the xtd::drawing::size_f class from the specified dimensions. More...
 

Properties

float height () const noexcept
 Gets he vertical component of this xtd::drawing::size_f class. More...
 
void height (float value) noexcept
 Sets the vertical component of this xtd::drawing::size_f Class. More...
 
bool is_empty () const noexcept
 Tests whether this Size class has xtd::drawing::size_f::width and xtd::drawing::size_f::height of 0. More...
 
float width () const noexcept
 Gets the horizontal component of this xtd::drawing::size_f class. More...
 
void width (float value) noexcept
 Sets the horizontal component of this xtd::drawing::size_f class. More...
 

Methods

xtd::ustring to_string () const noexcept override
 Creates a human-readable string that represents this xtd::drawing::size_f class. More...
 
static xtd::drawing::size_f add (const xtd::drawing::size_f &size1, const xtd::drawing::size_f &size2) noexcept
 Adds the width and height of one xtd::drawing::size_f class to the width and height of another xtd::drawing::size_f class. More...
 
static xtd::drawing::size_f subtract (const xtd::drawing::size_f &sz1, const xtd::drawing::size_f &sz2) noexcept
 Returns the result of subtracting specified xtd::drawing::size_f from the specified 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_f() [1/3]

xtd::drawing::size_f::size_f ( )
defaultnoexcept

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

Initializes a new instance of the xtd::drawing::size_f class from the specified xtd::drawing::point_f class.

Parameters
pointThe xtd::drawing::point_f class from which to initialize this xtd::drawing::size_f class

◆ size_f() [3/3]

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

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

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

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

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

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

◆ height() [1/2]

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

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

Returns
The vertical component of this xtd::drawing::size_f class, typically measured in pixels.
Remarks
The unit for the xtd::drawing::size_f::height and xtd::drawing::size_f::width of the xtd::drawing::size_f 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:
user_control.cpp.

◆ height() [2/2]

void xtd::drawing::size_f::height ( float  value)
noexcept

Sets the vertical component of this xtd::drawing::size_f Class.

Parameters
valueThe vertical component of this xtd::drawing::size_f class, typically measured in pixels.
Remarks
The unit for the xtd::drawing::size_f::height and xtd::drawing::size_f::width of the xtd::drawing::size_f 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_f::is_empty ( ) const
noexcept

Tests whether this Size class has xtd::drawing::size_f::width and xtd::drawing::size_f::height of 0.

Returns
Returns true when this xtd::drawing::size_f class has both a xtd::drawing::size_fwidth and xtd::drawing::size_fheight 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 
)
staticnoexcept

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

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

◆ to_string()

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

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

Returns
A xtd::ustring that represents this size.

Reimplemented from xtd::object.

◆ width() [1/2]

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

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

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

◆ width() [2/2]

void xtd::drawing::size_f::width ( float  value)
noexcept

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

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