Packages

 

com.aspose.imaging

Interfaces

Classes

Exceptions

com.aspose.imaging

Class Size

  • java.lang.Object
    • com.aspose.ms.System.ValueType<T>
      • com.aspose.ms.lang.Struct<Size>
        • com.aspose.imaging.Size


  • public class Size
    extends com.aspose.ms.lang.Struct<Size>

    Represents size.

    • Constructor Summary

      Constructors 
      Constructor and Description
      Size() 
      Size(int width, int height)
      Initializes a new instance of the Aspose.Imaging.Size structure from the specified dimensions.
      Size(Point point)
      Initializes a new instance of the Aspose.Imaging.Size structure from the specified Aspose.Imaging.Point.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      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.
      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.
      Size Clone() 
      void CloneTo(Size that) 
      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.
      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.
      int getHeight()
      Gets or sets the vertical component of this Aspose.Imaging.Size.
      int getWidth()
      Gets or sets the horizontal component of this Aspose.Imaging.Size.
      int hashCode()
      Returns a hash code for this Aspose.Imaging.Size structure.
      boolean isEmpty()
      Gets a value indicating whether this Aspose.Imaging.Size has width and height of 0.
      static boolean isEquals(Size obj1, Size obj2) 
      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.
      static boolean op_Equality(Size size1, Size size2)
      Tests whether two Aspose.Imaging.Size structures are equal.
      static boolean op_Inequality(Size size1, Size size2)
      Tests whether two Aspose.Imaging.Size structures are different.
      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.
      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.
      void setHeight(int value)
      Gets or sets the vertical component of this Aspose.Imaging.Size.
      void setWidth(int value)
      Gets or sets the horizontal component of this Aspose.Imaging.Size.
      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.
      static Point to_Point(Size size)
      Converts the specified Aspose.Imaging.Size to a Aspose.Imaging.Point.
      static SizeF to_SizeF(Size size)
      Converts the specified Aspose.Imaging.Size to a Aspose.Imaging.SizeF.
      String toString()
      Creates a human-readable string that represents this Aspose.Imaging.Size.
      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.
    • Constructor Detail

      • Size

        public Size()
      • Size

        public Size(Point point)

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

        Parameters:
        point - The Aspose.Imaging.Point from which to initialize this Aspose.Imaging.Size.
      • Size

        public Size(int width,
                    int height)

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

        Parameters:
        width - The width component of the new Aspose.Imaging.Size.
        height - The height component of the new Aspose.Imaging.Size.
    • Method Detail

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

      • isEmpty

        public boolean isEmpty()

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

      • getWidth

        public int getWidth()

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

      • setWidth

        public void setWidth(int value)

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

      • getHeight

        public int getHeight()

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

      • setHeight

        public void setHeight(int value)

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

      • to_SizeF

        public static SizeF to_SizeF(Size size)

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

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

        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:
        size1 - The first Aspose.Imaging.Size to add.
        size2 - The second Aspose.Imaging.Size to add.
        Returns:
        A Aspose.Imaging.Size structure that is the result of the addition operation.
      • op_Subtraction

        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:
        size1 - The Aspose.Imaging.Size structure on the left side of the subtraction operator.
        size2 - The Aspose.Imaging.Size structure on the right side of the subtraction operator.
        Returns:
        A Aspose.Imaging.Size structure that is the result of the subtraction operation.
      • op_Equality

        public static boolean op_Equality(Size size1,
                                          Size size2)

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

        Parameters:
        size1 - The Aspose.Imaging.Size structure on the left side of the equality operator.
        size2 - The Aspose.Imaging.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 Aspose.Imaging.Size structures are different.

        Parameters:
        size1 - The Aspose.Imaging.Size structure on the left of the inequality operator.
        size2 - The Aspose.Imaging.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.
      • to_Point

        public static Point to_Point(Size size)

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

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

        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:
        size1 - The first Aspose.Imaging.Size to add.
        size2 - The second Aspose.Imaging.Size to add.
        Returns:
        A Aspose.Imaging.Size structure that is the result of the addition operation.
      • ceiling

        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:
        size - The Aspose.Imaging.SizeF structure to convert.
        Returns:
        The Aspose.Imaging.Size structure this method converts to.
      • subtract

        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:
        size1 - The Aspose.Imaging.Size structure on the left side of the subtraction operator.
        size2 - The Aspose.Imaging.Size structure on the right side of the subtraction operator.
        Returns:
        The Aspose.Imaging.Size that is a result of the subtraction operation.
      • truncate

        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:
        size - The Aspose.Imaging.SizeF structure to convert.
        Returns:
        The Aspose.Imaging.Size structure this method converts to.
      • round

        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:
        size - The Aspose.Imaging.SizeF structure to convert.
        Returns:
        The Aspose.Imaging.Size structure this method converts to.
      • equals

        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.

        Overrides:
        equals in class Object
        Parameters:
        obj - The System.Object to test.
        Returns:
        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.

        Overrides:
        hashCode in class Object
        Returns:
        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.

        Overrides:
        toString in class Object
        Returns:
        A string that represents this Aspose.Imaging.Size.
      • CloneTo

        public void CloneTo(Size that)
        Specified by:
        CloneTo in class com.aspose.ms.System.ValueType<Size>
      • Clone

        public Size Clone()
        Specified by:
        Clone in class com.aspose.ms.System.ValueType<Size>
      • isEquals

        public static boolean isEquals(Size obj1,
                                       Size obj2)