com.aspose.imaging
Class Size

java.lang.Object
  extended by 
      extended by com.aspose.imaging.Size

public class Size
extends

Represents size.


Constructor Summary
Size()
           
Size(int width, int height)
           Initializes a new instance of the Size structure from the specified dimensions.
Size(Point point)
           Initializes a new instance of the Size structure from the specified Point.
 
Method Summary
static Size add(Size size1, Size size2)
           Adds the width and height of one Size structure to the width and height of another Size structure.
static Size ceiling(SizeF size)
           Converts the specified SizeF structure to a Size structure by rounding the values of the Size structure to the next higher integer values.
 java.lang.Object clone()
           
 Size Clone()
           
 void CloneTo(Size that)
           
 boolean equals(java.lang.Object obj)
           
static boolean equals(Size obj1, Size obj2)
           
static Size getEmpty()
           Gets a new instance of the Size structure that has Size.Width and Size.Height values set to zero.
 int getHeight()
           Gets the vertical component of this Size.
 int getWidth()
           Gets the horizontal component of this Size.
 int hashCode()
           Returns a hash code for this Size structure.
 boolean isEmpty()
           Gets a value indicating whether this Size has width and height of 0.
static Size op_Addition(Size size1, Size size2)
           Adds the width and height of one Size structure to the width and height of another Size structure.
static boolean op_Equality(Size size1, Size size2)
           Tests whether two Size structures are equal.
static boolean op_Inequality(Size size1, Size size2)
           Tests whether two Size structures are different.
static Size op_Subtraction(Size size1, Size size2)
           Subtracts the width and height of one Size structure from the width and height of another Size structure.
static Size round(SizeF size)
           Converts the specified SizeF structure to a Size structure by rounding the values of the SizeF structure to the nearest integer values.
 void setHeight(int value)
           Sets the vertical component of this Size.
 void setWidth(int value)
           Sets the horizontal component of this Size.
static Size subtract(Size size1, Size size2)
           Subtracts the width and height of one Size structure from the width and height of another Size structure.
static Point toPoint(Size size)
           Converts the specified Size to a Point.
static SizeF toSizeF(Size size)
           Converts the specified Size to a SizeF.
 java.lang.String toString()
           Creates a human-readable string that represents this Size.
static Size truncate(SizeF size)
           Converts the specified SizeF structure to a Size structure by truncating the values of the SizeF structure to the next lower integer values.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Size

public Size()

Size

public Size(int width,
            int height)

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

Parameters:
width - The width component of the new Size.
height - The height component of the new Size.

Size

public Size(Point point)

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

Parameters:
point - The Point from which to initialize this Size.
Method Detail

add

public static Size add(Size size1,
                       Size size2)

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

Parameters:
size1 - The first Size to add.
size2 - The second Size to add.
Returns:
A Size structure that is the result of the addition operation.

ceiling

public static Size ceiling(SizeF size)

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

Parameters:
size - The SizeF structure to convert.
Returns:
The Size structure this method converts to.

clone

public java.lang.Object clone()

Clone

public Size Clone()

CloneTo

public void CloneTo(Size that)

equals

public boolean equals(java.lang.Object obj)

equals

public static boolean equals(Size obj1,
                             Size obj2)

getEmpty

public static Size getEmpty()

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


getHeight

public int getHeight()

Gets the vertical component of this Size.


getWidth

public int getWidth()

Gets the horizontal component of this Size.


hashCode

public int hashCode()

Returns a hash code for this Size structure.

Returns:
An integer value that specifies a hash value for this Size structure.

isEmpty

public boolean isEmpty()

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


op_Addition

public static Size op_Addition(Size size1,
                               Size size2)

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

Parameters:
size1 - The first Size to add.
size2 - The second Size to add.
Returns:
A Size structure that is the result of the addition operation.

op_Equality

public static boolean op_Equality(Size size1,
                                  Size size2)

Tests whether two Size structures are equal.

Parameters:
size1 - The Size structure on the left side of the equality operator.
size2 - The Size structure on the right of the equality operator.
Returns:
True if size1 and size2 have equal width and height; otherwise, false.

op_Inequality

public static boolean op_Inequality(Size size1,
                                    Size size2)

Tests whether two Size structures are different.

Parameters:
size1 - The Size structure on the left of the inequality operator.
size2 - The Size structure on the right of the inequality operator.
Returns:
True if size1 and size2 differ either in width or height; false if size1 and size2 are equal.

op_Subtraction

public static Size op_Subtraction(Size size1,
                                  Size size2)

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

Parameters:
size1 - The Size structure on the left side of the subtraction operator.
size2 - The Size structure on the right side of the subtraction operator.
Returns:
A Size structure that is the result of the subtraction operation.

round

public static Size round(SizeF size)

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

Parameters:
size - The SizeF structure to convert.
Returns:
The Size structure this method converts to.

setHeight

public void setHeight(int value)

Sets the vertical component of this Size.


setWidth

public void setWidth(int value)

Sets the horizontal component of this Size.


subtract

public static Size subtract(Size size1,
                            Size size2)

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

Parameters:
size1 - The Size structure on the left side of the subtraction operator.
size2 - The Size structure on the right side of the subtraction operator.
Returns:
The Size that is a result of the subtraction operation.

toPoint

public static Point toPoint(Size size)

Converts the specified Size to a Point.

Parameters:
size - The Size to convert.
Returns:
The Point structure to which this operator converts.

toSizeF

public static SizeF toSizeF(Size size)

Converts the specified Size to a SizeF.

Parameters:
size - The Size to convert.
Returns:
The SizeF structure to which this operator converts.

toString

public java.lang.String toString()

Creates a human-readable string that represents this Size.

Returns:
A string that represents this Size.

truncate

public static Size truncate(SizeF size)

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

Parameters:
size - The SizeF structure to convert.
Returns:
The Size structure this method converts to.