SizeF
Inheritance: java.lang.Object, com.aspose.ms.System.ValueType, com.aspose.ms.lang.Struct
All Implemented Interfaces: com.aspose.ms.System.IEquatable, java.lang.Cloneable
public class SizeF extends Struct<SizeF> implements System.IEquatable<SizeF>, Cloneable
Stores an ordered pair of floating-point numbers, typically the width and height of a rectangle.
Constructors
Constructor | Description |
---|---|
SizeF() | |
SizeF(float width, float height) | Initializes a new instance of the SizeF structure from the specified dimensions. |
SizeF(PointF pt) | Initializes a new instance of the SizeF struct. |
SizeF(SizeF size) | Initializes a new instance of the SizeF struct. |
Methods
Method | Description |
---|---|
op_Equality(SizeF sz1, SizeF sz2) | Tests whether two SizeF structures are equal. |
op_Inequality(SizeF sz1, SizeF sz2) | Tests whether two SizeF structures are different. |
add(SizeF sz1, SizeF sz2) | Adds the width and height of one SizeF structure to the width and height of another SizeF structure. |
subtract(SizeF sz1, SizeF sz2) | Subtracts the width and height of one SizeF structure from the width and height of another SizeF structure. |
op_Addition(SizeF sz1, SizeF sz2) | Adds the width and height of one SizeF structure to the width and height of another SizeF structure. |
op_Subtraction(SizeF sz1, SizeF sz2) | Subtracts the width and height of one SizeF structure from the width and height of another SizeF structure. |
op_Multiply(float left, SizeF right) | Multiplies SizeF by a float producing SizeF. |
op_Multiply(SizeF left, float right) | Multiplies SizeF by a float producing SizeF. |
op_Division(SizeF left, float right) | Divides SizeF by a float producing SizeF. |
to_PointF(SizeF size) | |
isEquals(SizeF obj1, SizeF obj2) | |
getEmpty() | |
isEmpty() | Gets a value indicating whether this SizeF structure has zero width and height. |
getWidth() | Gets the horizontal component of this SizeF structure. |
setWidth(float value) | Sets the horizontal component of this SizeF structure. |
getHeight() | Gets the vertical component of this SizeF structure. |
setHeight(float value) | Sets the vertical component of this SizeF structure. |
hashCode() | Returns a hash code for this SizeF structure. |
toString() | |
equals(Object obj) | Tests to see whether the specified object is a SizeF structure with the same dimensions as this SizeF structure. |
toSize() | Converts a SizeF structure to a Size structure. |
toPointF() | Converts a SizeF structure to a PointF structure. |
equals(SizeF other) | Tests whether other SizeF structure has the same size of this SizeF structure. |
CloneTo(SizeF that) | |
Clone() | |
clone() |
SizeF()
public SizeF()
SizeF(float width, float height)
public SizeF(float width, float 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 structure. |
height | float | The height component of the new SizeF structure. |
SizeF(PointF pt)
public SizeF(PointF pt)
Initializes a new instance of the SizeF struct.
Parameters:
Parameter | Type | Description |
---|---|---|
pt | PointF | The PointF structure from which to initialize this SizeF structure. |
SizeF(SizeF size)
public SizeF(SizeF size)
Initializes a new instance of the SizeF struct.
Parameters:
Parameter | Type | Description |
---|---|---|
size | SizeF | The SizeF structure from which to create the new SizeF structure. |
op_Equality(SizeF sz1, SizeF sz2)
public static boolean op_Equality(SizeF sz1, SizeF sz2)
Tests whether two SizeF structures are equal.
Parameters:
Parameter | Type | Description |
---|---|---|
sz1 | SizeF | The SizeF structure on the left side of the equality operator. |
sz2 | SizeF | The SizeF structure on the right of the equality operator. |
Returns:
boolean - This operator returns true if sz1
and sz2
have equal width and height; otherwise, false.
op_Inequality(SizeF sz1, SizeF sz2)
public static boolean op_Inequality(SizeF sz1, SizeF sz2)
Tests whether two SizeF structures are different.
Parameters:
Parameter | Type | Description |
---|---|---|
sz1 | SizeF | The SizeF structure on the left of the inequality operator. |
sz2 | SizeF | The SizeF structure on the right of the inequality operator. |
Returns:
boolean - This operator returns true if sz1
and sz2
differ either in width or height; false if sz1
and sz2
are equal.
add(SizeF sz1, SizeF sz2)
public static SizeF add(SizeF sz1, SizeF sz2)
Adds the width and height of one SizeF structure to the width and height of another SizeF structure.
Parameters:
Parameter | Type | Description |
---|---|---|
sz1 | SizeF | The first SizeF structure to add. |
sz2 | SizeF | The second SizeF structure to add. |
Returns: SizeF - A SizeF structure that is the result of the addition operation.
subtract(SizeF sz1, SizeF sz2)
public static SizeF subtract(SizeF sz1, SizeF sz2)
Subtracts the width and height of one SizeF structure from the width and height of another SizeF structure.
Parameters:
Parameter | Type | Description |
---|---|---|
sz1 | SizeF | The SizeF structure on the left side of the subtraction operator. |
sz2 | SizeF | The SizeF structure on the right side of the subtraction operator. |
Returns: SizeF - A SizeF structure that is a result of the subtraction operation.
op_Addition(SizeF sz1, SizeF sz2)
public static SizeF op_Addition(SizeF sz1, SizeF sz2)
Adds the width and height of one SizeF structure to the width and height of another SizeF structure.
Parameters:
Parameter | Type | Description |
---|---|---|
sz1 | SizeF | The first SizeF structure to add. |
sz2 | SizeF | The second SizeF structure to add. |
Returns: SizeF - A Size structure that is the result of the addition operation.
op_Subtraction(SizeF sz1, SizeF sz2)
public static SizeF op_Subtraction(SizeF sz1, SizeF sz2)
Subtracts the width and height of one SizeF structure from the width and height of another SizeF structure.
Parameters:
Parameter | Type | Description |
---|---|---|
sz1 | SizeF | The SizeF structure on the left side of the subtraction operator. |
sz2 | SizeF | The SizeF structure on the right side of the subtraction operator. |
Returns: SizeF - A SizeF that is the result of the subtraction operation.
op_Multiply(float left, SizeF right)
public static SizeF op_Multiply(float left, SizeF right)
Multiplies SizeF by a float
producing SizeF.
Parameters:
Parameter | Type | Description |
---|---|---|
left | float | Multiplier of type float . |
right | SizeF | Multiplicand of type SizeF. |
Returns: SizeF - Product of type SizeF.
op_Multiply(SizeF left, float right)
public static SizeF op_Multiply(SizeF left, float right)
Multiplies SizeF by a float
producing SizeF.
Parameters:
Parameter | Type | Description |
---|---|---|
left | SizeF | Multiplicand of type SizeF. |
right | float | Multiplier of type float . |
Returns: SizeF - Product of type SizeF.
op_Division(SizeF left, float right)
public static SizeF op_Division(SizeF left, float right)
Divides SizeF by a float
producing SizeF.
Parameters:
Parameter | Type | Description |
---|---|---|
left | SizeF | Dividend of type SizeF. |
right | float | Divisor of type int . |
Returns: SizeF - Result of type SizeF.
to_PointF(SizeF size)
public static PointF to_PointF(SizeF size)
Parameters:
Parameter | Type | Description |
---|---|---|
size | SizeF |
Returns: PointF
isEquals(SizeF obj1, SizeF obj2)
public static boolean isEquals(SizeF obj1, SizeF obj2)
Parameters:
Parameter | Type | Description |
---|---|---|
obj1 | SizeF | |
obj2 | SizeF |
Returns: boolean
getEmpty()
public static SizeF getEmpty()
Returns: SizeF
isEmpty()
public final boolean isEmpty()
Gets a value indicating whether this SizeF structure has zero width and height.
Returns: boolean - a value indicating whether this SizeF structure has zero width and height.
getWidth()
public final float getWidth()
Gets the horizontal component of this SizeF structure.
Returns: float - the horizontal component of this SizeF structure.
setWidth(float value)
public final void setWidth(float value)
Sets the horizontal component of this SizeF structure.
Parameters:
Parameter | Type | Description |
---|---|---|
value | float | the horizontal component of this SizeF structure. |
getHeight()
public final float getHeight()
Gets the vertical component of this SizeF structure.
Returns: float - the vertical component of this SizeF structure.
setHeight(float value)
public final void setHeight(float value)
Sets the vertical component of this SizeF structure.
Parameters:
Parameter | Type | Description |
---|---|---|
value | float | the vertical component of this SizeF structure. |
hashCode()
public int hashCode()
Returns a hash code for this SizeF structure.
Returns: int - An integer value that specifies a hash value for this SizeF structure.
toString()
public String toString()
Returns: java.lang.String
equals(Object obj)
public boolean equals(Object obj)
Tests to see whether the specified object is a SizeF structure with the same dimensions as this SizeF structure.
Parameters:
Parameter | Type | Description |
---|---|---|
obj | java.lang.Object | The Object to test. |
Returns:
boolean - This method returns true
if obj is a SizeF and has the same width and height as this SizeF; otherwise, false
.
toSize()
public final Size toSize()
Converts a SizeF structure to a Size structure.
Returns: Size - Returns a Size structure.
toPointF()
public final PointF toPointF()
Converts a SizeF structure to a PointF structure.
Returns: PointF - Returns a PointF structure.
equals(SizeF other)
public final boolean equals(SizeF other)
Tests whether other SizeF structure has the same size of this SizeF structure.
Parameters:
Parameter | Type | Description |
---|---|---|
other | SizeF | Other size to test |
Returns:
boolean - This method returns true
if other SizeF structure and its Width and Height properties are equal to the corresponding properties of this SizeF structure; otherwise, false
.
CloneTo(SizeF that)
public void CloneTo(SizeF that)
Parameters:
Parameter | Type | Description |
---|---|---|
that | SizeF |
Clone()
public SizeF Clone()
Returns: SizeF
clone()
public Object clone()
Returns: java.lang.Object