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

Constructors

NameDescription
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

NameTypeAccessDescription
empty [static]SizeFrGets a new instance of the SizeF structure that has SizeF.width and SizeF.height values set to zero.
heightfloatr/wGets or sets the vertical component of this SizeF.
is_emptyboolrGets a value indicating whether this SizeF has zero width and height.
widthfloatr/wGets or sets the horizontal component of this SizeF.

Methods

NameDescription
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:

ParameterTypeDescription
pointPointFThe 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:

ParameterTypeDescription
sizeSizeFThe 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:

ParameterTypeDescription
widthfloatThe width component of the new SizeF.
heightfloatThe 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:

ParameterTypeDescription
size1SizeFThe first SizeF to add.
size2SizeFThe second SizeF to add.

Returns

TypeDescription
SizeFA 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:

ParameterTypeDescription
size1SizeFThe SizeF structure on the left side of the subtraction operator.
size2SizeFThe SizeF structure on the right side of the subtraction operator.

Returns

TypeDescription
SizeFThe SizeF that is a result of the subtraction operation.

Method: to_point_f()

 to_point_f() 

Converts a SizeF to a PointF.

Returns

TypeDescription
PointFReturns a PointF structure.

Method: to_size()

 to_size() 

Converts a SizeF to a Size structure with truncated size values.

Returns

TypeDescription
SizeReturns a Size structure.