SizeF Class
Summary: Stores an ordered pair of floating-point numbers, typically the width and height of a rectangle.
Module: aspose.psd
Full Name: aspose.psd.SizeF
Aspose.PSD Version: 24.12.0
Constructors
| Name | Description |
|---|---|
| SizeF() | Initializes a new instance of the SizeF class |
| SizeF(point) | Initializes a new instance of the SizeF structure from the specified PointF. |
| SizeF(size) | Initializes a new instance of the SizeF structure from the specified SizeF. |
| SizeF(width, height) | Initializes a new instance of the SizeF structure from the specified dimensions. |
Properties
| Name | Type | Access | Description |
|---|---|---|---|
| empty [static] | SizeF | r | Gets a new instance of the SizeF structure that has SizeF.width and SizeF.height values set to zero. |
| height | float | r/w | Gets or sets the vertical component of this SizeF. |
| is_empty | bool | r | Gets a value indicating whether this SizeF has zero width and height. |
| width | float | r/w | Gets or sets the horizontal component of this SizeF. |
Methods
| Name | Description |
|---|---|
| add(size1, size2) | Adds the width and height of one SizeF structure to the width and height of another SizeF structure. |
| subtract(size1, size2) | Subtracts the width and height of one SizeF structure from the width and height of another SizeF structure. |
| to_point_f() | Converts a SizeF to a PointF. |
| to_size() | Converts a SizeF to a Size structure with truncated size values. |
Constructor: SizeF()
SizeF()
Initializes a new instance of the SizeF class
Constructor: SizeF(point)
SizeF(point)
Initializes a new instance of the SizeF structure from the specified PointF.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| point | PointF | The PointF from which to initialize this SizeF. |
Constructor: SizeF(size)
SizeF(size)
Initializes a new instance of the SizeF structure from the specified SizeF.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| size | SizeF | The SizeF from which to create the new SizeF. |
Constructor: SizeF(width, height)
SizeF(width, height)
Initializes a new instance of the SizeF structure from the specified dimensions.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| width | float | The width component of the new SizeF. |
| height | float | The height component of the new SizeF. |
Method: add(size1, size2) [static]
add(size1, size2)
Adds the width and height of one SizeF structure to the width and height of another SizeF structure.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| size1 | SizeF | The first SizeF to add. |
| size2 | SizeF | The second SizeF to add. |
Returns
| Type | Description |
|---|---|
| SizeF | A SizeF structure that is the result of the addition operation. |
Method: subtract(size1, size2) [static]
subtract(size1, size2)
Subtracts the width and height of one SizeF structure from the width and height of another SizeF structure.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| size1 | SizeF | The SizeF structure on the left side of the subtraction operator. |
| size2 | SizeF | The SizeF structure on the right side of the subtraction operator. |
Returns
| Type | Description |
|---|---|
| SizeF | The SizeF that is a result of the subtraction operation. |
Method: to_point_f()
to_point_f()
Returns
| Type | Description |
|---|---|
| PointF | Returns a PointF structure. |
Method: to_size()
to_size()
Converts a SizeF to a Size structure with truncated size values.
Returns
| Type | Description |
|---|---|
| Size | Returns a Size structure. |