Size

Inheritance: java.lang.Object, com.aspose.ms.System.ValueType, com.aspose.ms.lang.Struct

public class Size extends Struct<Size>

Represents size.

Constructors

ConstructorDescription
Size()
Size(Point point)Initializes a new instance of the Aspose.Imaging.Size structure from the specified Aspose.Imaging.Point.
Size(int width, int height)Initializes a new instance of the Aspose.Imaging.Size structure from the specified dimensions.

Methods

MethodDescription
getEmpty()Gets a new instance of the Aspose.Imaging.Size structure that has Aspose.Imaging.Size.Width and Aspose.Imaging.Size.Height values set to zero.
to_SizeF(Size size)Converts the specified Aspose.Imaging.Size to a Aspose.Imaging.SizeF.
op_Addition(Size size1, Size size2)Adds the width and height of one Aspose.Imaging.Size structure to the width and height of another Aspose.Imaging.Size structure.
op_Subtraction(Size size1, Size size2)Subtracts the width and height of one Aspose.Imaging.Size structure from the width and height of another Aspose.Imaging.Size structure.
op_Equality(Size size1, Size size2)Tests whether two Aspose.Imaging.Size structures are equal.
op_Inequality(Size size1, Size size2)Tests whether two Aspose.Imaging.Size structures are different.
to_Point(Size size)Converts the specified Aspose.Imaging.Size to a Aspose.Imaging.Point.
add(Size size1, Size size2)Adds the width and height of one Aspose.Imaging.Size structure to the width and height of another Aspose.Imaging.Size structure.
ceiling(SizeF size)Converts the specified Aspose.Imaging.SizeF structure to a Aspose.Imaging.Size structure by rounding the values of the Aspose.Imaging.Size structure to the next higher integer values.
subtract(Size size1, Size size2)Subtracts the width and height of one Aspose.Imaging.Size structure from the width and height of another Aspose.Imaging.Size structure.
truncate(SizeF size)Converts the specified Aspose.Imaging.SizeF structure to a Aspose.Imaging.Size structure by truncating the values of the Aspose.Imaging.SizeF structure to the next lower integer values.
round(SizeF size)Converts the specified Aspose.Imaging.SizeF structure to a Aspose.Imaging.Size structure by rounding the values of the Aspose.Imaging.SizeF structure to the nearest integer values.
isEquals(Size obj1, Size obj2)
isEmpty()Gets a value indicating whether this Aspose.Imaging.Size has width and height of 0.
getWidth()Gets or sets the horizontal component of this Aspose.Imaging.Size.
setWidth(int value)Gets or sets the horizontal component of this Aspose.Imaging.Size.
getHeight()Gets or sets the vertical component of this Aspose.Imaging.Size.
setHeight(int value)Gets or sets the vertical component of this Aspose.Imaging.Size.
equals(Object obj)Tests to see whether the specified object is a Aspose.Imaging.Size with the same dimensions as this Aspose.Imaging.Size.
hashCode()Returns a hash code for this Aspose.Imaging.Size structure.
toString()Creates a human-readable string that represents this Aspose.Imaging.Size.
CloneTo(Size that)
Clone()

Size()

public Size()

Size(Point point)

public Size(Point point)

Initializes a new instance of the Aspose.Imaging.Size structure from the specified Aspose.Imaging.Point.

Parameters:

ParameterTypeDescription
pointPointThe Aspose.Imaging.Point from which to initialize this Aspose.Imaging.Size.

Size(int width, int height)

public Size(int width, int height)

Initializes a new instance of the Aspose.Imaging.Size structure from the specified dimensions.

Parameters:

ParameterTypeDescription
widthintThe width component of the new Aspose.Imaging.Size.
heightintThe height component of the new Aspose.Imaging.Size.

getEmpty()

public static Size getEmpty()

Gets a new instance of the Aspose.Imaging.Size structure that has Aspose.Imaging.Size.Width and Aspose.Imaging.Size.Height values set to zero.

Returns: Size

to_SizeF(Size size)

public static SizeF to_SizeF(Size size)

Converts the specified Aspose.Imaging.Size to a Aspose.Imaging.SizeF.

Parameters:

ParameterTypeDescription
sizeSizeThe Aspose.Imaging.Size to convert.

Returns: SizeF - The Aspose.Imaging.SizeF structure to which this operator converts.

op_Addition(Size size1, Size size2)

public static Size op_Addition(Size size1, Size size2)

Adds the width and height of one Aspose.Imaging.Size structure to the width and height of another Aspose.Imaging.Size structure.

Parameters:

ParameterTypeDescription
size1SizeThe first Aspose.Imaging.Size to add.
size2SizeThe second Aspose.Imaging.Size to add.

Returns: Size - A Aspose.Imaging.Size structure that is the result of the addition operation.

op_Subtraction(Size size1, Size size2)

public static Size op_Subtraction(Size size1, Size size2)

Subtracts the width and height of one Aspose.Imaging.Size structure from the width and height of another Aspose.Imaging.Size structure.

Parameters:

ParameterTypeDescription
size1SizeThe Aspose.Imaging.Size structure on the left side of the subtraction operator.
size2SizeThe Aspose.Imaging.Size structure on the right side of the subtraction operator.

Returns: Size - A Aspose.Imaging.Size structure that is the result of the subtraction operation.

op_Equality(Size size1, Size size2)

public static boolean op_Equality(Size size1, Size size2)

Tests whether two Aspose.Imaging.Size structures are equal.

Parameters:

ParameterTypeDescription
size1SizeThe Aspose.Imaging.Size structure on the left side of the equality operator.
size2SizeThe Aspose.Imaging.Size structure on the right of the equality operator.

Returns: boolean - True if size1 and size2 have equal width and height; otherwise, false.

op_Inequality(Size size1, Size size2)

public static boolean op_Inequality(Size size1, Size size2)

Tests whether two Aspose.Imaging.Size structures are different.

Parameters:

ParameterTypeDescription
size1SizeThe Aspose.Imaging.Size structure on the left of the inequality operator.
size2SizeThe Aspose.Imaging.Size structure on the right of the inequality operator.

Returns: boolean - True if size1 and size2 differ either in width or height; false if size1 and size2 are equal.

to_Point(Size size)

public static Point to_Point(Size size)

Converts the specified Aspose.Imaging.Size to a Aspose.Imaging.Point.

Parameters:

ParameterTypeDescription
sizeSizeThe Aspose.Imaging.Size to convert.

Returns: Point - The Aspose.Imaging.Point structure to which this operator converts.

add(Size size1, Size size2)

public static Size add(Size size1, Size size2)

Adds the width and height of one Aspose.Imaging.Size structure to the width and height of another Aspose.Imaging.Size structure.

Parameters:

ParameterTypeDescription
size1SizeThe first Aspose.Imaging.Size to add.
size2SizeThe second Aspose.Imaging.Size to add.

Returns: Size - A Aspose.Imaging.Size structure that is the result of the addition operation.

ceiling(SizeF size)

public static Size ceiling(SizeF size)

Converts the specified Aspose.Imaging.SizeF structure to a Aspose.Imaging.Size structure by rounding the values of the Aspose.Imaging.Size structure to the next higher integer values.

Parameters:

ParameterTypeDescription
sizeSizeFThe Aspose.Imaging.SizeF structure to convert.

Returns: Size - The Aspose.Imaging.Size structure this method converts to.

subtract(Size size1, Size size2)

public static Size subtract(Size size1, Size size2)

Subtracts the width and height of one Aspose.Imaging.Size structure from the width and height of another Aspose.Imaging.Size structure.

Parameters:

ParameterTypeDescription
size1SizeThe Aspose.Imaging.Size structure on the left side of the subtraction operator.
size2SizeThe Aspose.Imaging.Size structure on the right side of the subtraction operator.

Returns: Size - The Aspose.Imaging.Size that is a result of the subtraction operation.

truncate(SizeF size)

public static Size truncate(SizeF size)

Converts the specified Aspose.Imaging.SizeF structure to a Aspose.Imaging.Size structure by truncating the values of the Aspose.Imaging.SizeF structure to the next lower integer values.

Parameters:

ParameterTypeDescription
sizeSizeFThe Aspose.Imaging.SizeF structure to convert.

Returns: Size - The Aspose.Imaging.Size structure this method converts to.

round(SizeF size)

public static Size round(SizeF size)

Converts the specified Aspose.Imaging.SizeF structure to a Aspose.Imaging.Size structure by rounding the values of the Aspose.Imaging.SizeF structure to the nearest integer values.

Parameters:

ParameterTypeDescription
sizeSizeFThe Aspose.Imaging.SizeF structure to convert.

Returns: Size - The Aspose.Imaging.Size structure this method converts to.

isEquals(Size obj1, Size obj2)

public static boolean isEquals(Size obj1, Size obj2)

Parameters:

ParameterTypeDescription
obj1Size
obj2Size

Returns: boolean

isEmpty()

public boolean isEmpty()

Gets a value indicating whether this Aspose.Imaging.Size has width and height of 0.

Returns: boolean

getWidth()

public int getWidth()

Gets or sets the horizontal component of this Aspose.Imaging.Size.

Returns: int

setWidth(int value)

public void setWidth(int value)

Gets or sets the horizontal component of this Aspose.Imaging.Size.

Parameters:

ParameterTypeDescription
valueint

getHeight()

public int getHeight()

Gets or sets the vertical component of this Aspose.Imaging.Size.

Returns: int

setHeight(int value)

public void setHeight(int value)

Gets or sets the vertical component of this Aspose.Imaging.Size.

Parameters:

ParameterTypeDescription
valueint

equals(Object obj)

public boolean equals(Object obj)

Tests to see whether the specified object is a Aspose.Imaging.Size with the same dimensions as this Aspose.Imaging.Size.

Parameters:

ParameterTypeDescription
objjava.lang.ObjectThe System.Object to test.

Returns: boolean - True if obj is a Aspose.Imaging.Size and has the same width and height as this Aspose.Imaging.Size; otherwise, false.

hashCode()

public int hashCode()

Returns a hash code for this Aspose.Imaging.Size structure.

Returns: int - An integer value that specifies a hash value for this Aspose.Imaging.Size structure.

toString()

public String toString()

Creates a human-readable string that represents this Aspose.Imaging.Size.

Returns: java.lang.String - A string that represents this Aspose.Imaging.Size.

CloneTo(Size that)

public void CloneTo(Size that)

Parameters:

ParameterTypeDescription
thatSize

Clone()

public Size Clone()

Returns: Size