public class SizeF extends com.aspose.ms.lang.Struct<SizeF>
Stores an ordered pair of floating-point numbers, typically the width and height of a rectangle.
Constructor and Description |
---|
SizeF() |
SizeF(float width,
float height)
Initializes a new instance of the
SizeF structure from the specified dimensions. |
SizeF(PointF point)
Initializes a new instance of the
SizeF structure from the specified PointF . |
SizeF(SizeF size)
Initializes a new instance of the
SizeF structure from the specified SizeF . |
Modifier and Type | Method and Description |
---|---|
static SizeF |
add(SizeF size1,
SizeF size2)
Adds the width and height of one
SizeF structure to the width and height of another SizeF structure. |
Object |
clone() |
SizeF |
Clone() |
void |
CloneTo(SizeF that) |
boolean |
equals(Object obj)
Tests to see whether the specified object is a
SizeF with the same dimensions as this SizeF . |
static SizeF |
getEmpty()
Gets a new instance of the
SizeF structure that has Aspose.PSD.SizeF.Width (SizeF.getWidth() /SizeF.setWidth(float) ) and Aspose.PSD.SizeF.Height (SizeF.getHeight() /SizeF.setHeight(float) ) values set to zero. |
float |
getHeight()
Gets or sets the vertical component of this
SizeF . |
float |
getWidth()
Gets or sets the horizontal component of this
SizeF . |
int |
hashCode()
Returns a hash code for this
Size structure. |
boolean |
isEmpty()
Gets a value indicating whether this
SizeF has zero width and height. |
static SizeF |
op_Addition(SizeF size1,
SizeF size2)
Adds the width and height of one
SizeF structure to the width and height of another SizeF structure. |
static boolean |
op_Equality(SizeF size1,
SizeF size2)
Tests whether two
SizeF structures are equal. |
static boolean |
op_Inequality(SizeF size1,
SizeF size2)
Tests whether two
SizeF structures are different. |
static SizeF |
op_Subtraction(SizeF size1,
SizeF size2)
Subtracts the width and height of one
SizeF structure from the width and height of another SizeF structure. |
void |
setHeight(float value)
Gets or sets the vertical component of this
SizeF . |
void |
setWidth(float value)
Gets or sets the horizontal component of this
SizeF . |
static SizeF |
subtract(SizeF size1,
SizeF size2)
Subtracts the width and height of one
SizeF structure from the width and height of another SizeF structure. |
static PointF |
to_PointF(SizeF size)
Converts the specified
SizeF to a PointF . |
PointF |
toPointF()
Converts a
SizeF to a PointF . |
Size |
toSize()
Converts a
SizeF to a Size structure with truncated size values. |
String |
toString()
Creates a human-readable string that represents this
SizeF . |
public SizeF()
public SizeF(SizeF size)
Initializes a new instance of the SizeF
structure from the specified SizeF
.
size
- The SizeF
from which to create the new SizeF
.public SizeF(PointF point)
Initializes a new instance of the SizeF
structure from the specified PointF
.
point
- The PointF
from which to initialize this SizeF
.public SizeF(float width, float height)
Initializes a new instance of the SizeF
structure from the specified dimensions.
width
- The width component of the new SizeF
.height
- The height component of the new SizeF
.public static SizeF getEmpty()
Gets a new instance of the SizeF
structure that has Aspose.PSD.SizeF.Width
(SizeF.getWidth()
/SizeF.setWidth(float)
) and Aspose.PSD.SizeF.Height
(SizeF.getHeight()
/SizeF.setHeight(float)
) values set to zero.
public final boolean isEmpty()
Gets a value indicating whether this SizeF
has zero width and height.
SizeF
has both a width and height of zero; otherwise, false.public final float getWidth()
Gets or sets the horizontal component of this SizeF
.
SizeF
, typically measured in pixels.public final void setWidth(float value)
Gets or sets the horizontal component of this SizeF
.
public final float getHeight()
Gets or sets the vertical component of this SizeF
.
SizeF
, typically measured in pixels.public final void setHeight(float value)
Gets or sets the vertical component of this SizeF
.
public static SizeF op_Addition(SizeF size1, SizeF size2)
Adds the width and height of one SizeF
structure to the width and height of another SizeF
structure.
size1
- The first SizeF
to add.size2
- The second SizeF
to add.SizeF
structure that is the result of the addition operation.public static SizeF op_Subtraction(SizeF size1, SizeF size2)
Subtracts the width and height of one SizeF
structure from the width and height of another SizeF
structure.
size1
- The SizeF
on the left side of the subtraction operator.size2
- The SizeF
on the right side of the subtraction operator.SizeF
that is the result of the subtraction operation.public static boolean op_Equality(SizeF size1, SizeF size2)
Tests whether two SizeF
structures are equal.
size1
- The SizeF
structure on the left side of the equality operator.size2
- The SizeF
structure on the right of the equality operator.size1
and size2
have equal width and height; otherwise, false.public static boolean op_Inequality(SizeF size1, SizeF size2)
Tests whether two SizeF
structures are different.
size1
- The SizeF
structure on the left of the inequality operator.size2
- The SizeF
structure on the right of the inequality operator.size1
and size2
differ either in width or height; false if size1
and size2
are equal.public static PointF to_PointF(SizeF size)
Converts the specified SizeF
to a PointF
.
size
- The SizeF
structure to be convertedPointF
structure to which this operator converts.public static SizeF add(SizeF size1, SizeF size2)
Adds the width and height of one SizeF
structure to the width and height of another SizeF
structure.
size1
- The first SizeF
to add.size2
- The second SizeF
to add.SizeF
structure that is the result of the addition operation.public static SizeF subtract(SizeF size1, SizeF size2)
Subtracts the width and height of one SizeF
structure from the width and height of another SizeF
structure.
size1
- The SizeF
structure on the left side of the subtraction operator.size2
- The SizeF
structure on the right side of the subtraction operator.SizeF
that is a result of the subtraction operation.public final PointF toPointF()
Converts a SizeF
to a PointF
.
PointF
structure.public final Size toSize()
Converts a SizeF
to a Size
structure with truncated size values.
Size
structure.public boolean equals(Object obj)
Tests to see whether the specified object is a SizeF
with the same dimensions as this SizeF
.
public int hashCode()
Returns a hash code for this Size
structure.
public String toString()
Creates a human-readable string that represents this SizeF
.
public void CloneTo(SizeF that)
CloneTo
in class com.aspose.ms.System.ValueType<SizeF>
Copyright (c) 2008-2019 Aspose Pty Ltd. All Rights Reserved.