CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
size_f.h
1
2#ifndef _aspose_system_drawing_size_f_h_
3#define _aspose_system_drawing_size_f_h_
4
5#include "fwd.h"
6#include <system/string.h>
7#include <system/boxed_value.h>
8
9namespace System { namespace Drawing {
13 class ASPOSECPP_SHARED_CLASS SizeF
14 {
15 public:
17 ASPOSECPP_SHARED_API SizeF();
22 ASPOSECPP_SHARED_API SizeF(const PointF& point);
26 ASPOSECPP_SHARED_API SizeF(float width, float height);
27
31 inline bool get_IsEmpty() const { return (m_width == 0.0f && m_height == 0.0f); }
32
34 inline float get_Width() const { return m_width; }
36 inline float get_Height() const { return m_height; }
37
40 inline void set_Width(float value) { m_width = value; }
43 inline void set_Height(float value) { m_height = value; }
44
49 ASPOSECPP_SHARED_API bool Equals(const SizeF& size) const;
50
53 ASPOSECPP_SHARED_API PointF ToPointF() const;
54
58 ASPOSECPP_SHARED_API Size ToSize() const;
59
62 System::String ToString() const { return String::Format(u"{{Width={0}, Height={1}}}", m_width, m_height); }
64 ASPOSECPP_SHARED_API int32_t GetHashCode() const;
65
71 static ASPOSECPP_SHARED_API SizeF Add(const SizeF& size1, const SizeF& size2);
77 static ASPOSECPP_SHARED_API SizeF Subtract(const SizeF& size1, const SizeF& size2);
78
81 ASPOSECPP_SHARED_API operator PointF() const;
82
88 friend ASPOSECPP_SHARED_API SizeF operator+(const SizeF& size1, const SizeF& size2);
94 friend ASPOSECPP_SHARED_API SizeF operator-(const SizeF& size1, const SizeF& size2);
99 friend ASPOSECPP_SHARED_API bool operator==(const SizeF& size1, const SizeF& size2);
104 friend ASPOSECPP_SHARED_API bool operator!=(const SizeF& size1, const SizeF& size2);
105
110 ASPOSECPP_SHARED_API SizeF& operator+=(const SizeF& size);
111
113 static ASPOSECPP_SHARED_API const SizeF Empty;
114
115 private:
117 float m_width;
119 float m_height;
120
121 };
122
123}}
124
125namespace System
126{
128
130 template<> struct IsBoxable<Drawing::SizeF> : std::true_type {};
131
133 template <>
134 class BoxedValue<System::Drawing::SizeF> : public DefaultBoxedValue<System::Drawing::SizeF>
135 {
136 public:
140 : DefaultBoxedValue<System::Drawing::SizeF>(value)
141 {}
142 };
143
145}
146
147#endif // _aspose_system_drawing_size_f_h_
BoxedValue(const T &value)
Constructs an object that represents the specified value boxed.
Definition: boxed_value.h:192
Represents a pair of single-precision floating point X and Y coordinates of a point on a 2-dimensiona...
Definition: point_f.h:14
Represents a pair of single-precision floating point values that represent width and height of an ima...
Definition: size_f.h:14
friend bool operator==(const SizeF &size1, const SizeF &size2)
Determines the equality of two SizeF objects by comparing their corresponding width and height values...
friend bool operator!=(const SizeF &size1, const SizeF &size2)
Determines the inequality of two SizeF objects by comparing their corresponding width and height valu...
float get_Height() const
Returns the value of height represented by the current object.
Definition: size_f.h:36
bool Equals(const SizeF &size) const
Determines if the current object and the specified object are equal, i.e. represent the same pair of ...
bool get_IsEmpty() const
Determines if both width and hegiht values are equal to 0.
Definition: size_f.h:31
friend SizeF operator-(const SizeF &size1, const SizeF &size2)
Returns a new SizeF object that is the results of subctraction of size2 from size1,...
float get_Width() const
Returns the value of width represented by the current object.
Definition: size_f.h:34
PointF ToPointF() const
Converts the current object to an instance of Point object by initializing its X and Y coordinate wit...
static SizeF Subtract(const SizeF &size1, const SizeF &size2)
Returns a new SizeF object that is the results of subctraction of size2 from size1,...
int32_t GetHashCode() const
Returns a hash code for the current object.
SizeF & operator+=(const SizeF &size)
Adds the specified SizeF object's width and height values to the width and height values of the curre...
System::String ToString() const
Returns the string representation of the pair of width and hegiht values represented by the current o...
Definition: size_f.h:62
SizeF(float width, float height)
Constructs a new SizeF object and initializes it with the specified value.
void set_Width(float value)
Sets the value of width represented by the current object.
Definition: size_f.h:40
SizeF(const PointF &point)
Constructs a new SizeF object and initializes its width and height values with the values of X and Y ...
SizeF()
Constructs a new SizeF object and initializes its width and height values with 0.
Size ToSize() const
Constructs a Size object from the current SizeF object by truncating the SizeF object's width and hei...
friend SizeF operator+(const SizeF &size1, const SizeF &size2)
Returns a new SizeF object that is a sum of the specified SizeF objects, i.e. whose width value is eq...
void set_Height(float value)
Sets the value of height represented by the current object.
Definition: size_f.h:43
static SizeF Add(const SizeF &size1, const SizeF &size2)
Returns a new SizeF object that is a sum of the specified SizeF objects, i.e. whose width value is eq...
static const SizeF Empty
An empty instance of SizeF class whose width and height values are 0.
Definition: size_f.h:113
Represents a pair of integer values that represent width and height of an image. This type should be ...
Definition: size.h:14
String class used across the library. Is a substitute for C# System.String when translating code....
Definition: string.h:122
static String Format(const SharedPtr< IFormatProvider > &fp, const String &format, const Args &... args)
Formats string in C# style.
Definition: string.h:1405
Definition: db_command.h:9