Packages

 

com.aspose.imaging

Interfaces

Classes

Exceptions

com.aspose.imaging

Class RectangleF



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

    Stores a set of four floating-point numbers that represent the location and size of a rectangle.

    • Constructor Summary

      Constructors 
      Constructor and Description
      RectangleF() 
      RectangleF(float x, float y, float width, float height)
      Initializes a new instance of the Aspose.Imaging.RectangleF structure with the specified location and size.
      RectangleF(PointF location, SizeF size)
      Initializes a new instance of the Aspose.Imaging.RectangleF structure with the specified location and size.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      RectangleF Clone() 
      void CloneTo(RectangleF that) 
      boolean contains(float x, float y)
      Determines if the specified point is contained within this Aspose.Imaging.RectangleF structure.
      boolean contains(PointF point)
      Determines if the specified point is contained within this Aspose.Imaging.RectangleF structure.
      boolean contains(RectangleF rect)
      Determines if the rectangular region represented by rect is entirely contained within this Aspose.Imaging.RectangleF structure.
      boolean equals(Object obj)
      Tests whether obj is a Aspose.Imaging.RectangleF with the same location and size of this Aspose.Imaging.RectangleF.
      static RectangleF fromLeftTopRightBottom(float left, float top, float right, float bottom)
      Creates a Aspose.Imaging.RectangleF structure with upper-left corner and lower-right corner at the specified locations.
      static RectangleF fromPoints(PointF point1, PointF point2)
      Creates a new Rectangle from two points specified.
      float getBottom()
      Gets or sets the y-coordinate that is the sum of Aspose.Imaging.RectangleF.Y and Aspose.Imaging.RectangleF.Height of this Aspose.Imaging.RectangleF structure.
      static RectangleF getEmpty()
      Gets a new instance of the Aspose.Imaging.RectangleF structure that has Aspose.Imaging.RectangleF.X, Aspose.Imaging.RectangleF.Y, Aspose.Imaging.RectangleF.Width and Aspose.Imaging.RectangleF.Height values set to zero.
      float getHeight()
      Gets or sets the height of this Aspose.Imaging.RectangleF structure.
      float getLeft()
      Gets or sets the x-coordinate of the left edge of this Aspose.Imaging.RectangleF structure.
      PointF getLocation()
      Gets or sets the coordinates of the upper-left corner of this Aspose.Imaging.RectangleF structure.
      float getRight()
      Gets or sets the x-coordinate that is the sum of Aspose.Imaging.RectangleF.X and Aspose.Imaging.RectangleF.Width of this Aspose.Imaging.RectangleF structure.
      SizeF getSize()
      Gets or sets the size of this Aspose.Imaging.RectangleF.
      float getTop()
      Gets or sets the y-coordinate of the top edge of this Aspose.Imaging.RectangleF structure.
      float getWidth()
      Gets or sets the width of this Aspose.Imaging.RectangleF structure.
      float getX()
      Gets or sets the x-coordinate of the upper-left corner of this Aspose.Imaging.RectangleF structure.
      float getY()
      Gets or sets the y-coordinate of the upper-left corner of this Aspose.Imaging.RectangleF structure.
      int hashCode()
      Gets the hash code for this Aspose.Imaging.RectangleF structure.
      void inflate(float x, float y)
      Inflates this Aspose.Imaging.RectangleF structure by the specified amount.
      static RectangleF inflate(RectangleF rect, float x, float y)
      Creates and returns an inflated copy of the specified Aspose.Imaging.RectangleF structure.
      void inflate(SizeF size)
      Inflates this Aspose.Imaging.RectangleF by the specified amount.
      void intersect(RectangleF rect)
      Replaces this Aspose.Imaging.RectangleF structure with the intersection of itself and the specified Aspose.Imaging.RectangleF structure.
      static RectangleF intersect(RectangleF a, RectangleF b)
      Returns a Aspose.Imaging.RectangleF structure that represents the intersection of two rectangles.
      boolean intersectsWith(RectangleF rect)
      Determines if this rectangle intersects with rect.
      boolean isEmpty()
      Gets a value indicating whether the Aspose.Imaging.RectangleF.Width or Aspose.Imaging.RectangleF.Height property of this Aspose.Imaging.RectangleF has a value of zero.
      static boolean isEquals(RectangleF obj1, RectangleF obj2) 
      void normalize()
      Normalizes the rectangle by making it's width and height positive, left less than right and top less than bottom.
      void offset(float x, float y)
      Adjusts the location of this rectangle by the specified amount.
      void offset(PointF pos)
      Adjusts the location of this rectangle by the specified amount.
      static boolean op_Equality(RectangleF left, RectangleF right)
      Tests whether two Aspose.Imaging.RectangleF structures have equal location and size.
      static boolean op_Inequality(RectangleF left, RectangleF right)
      Tests whether two Aspose.Imaging.RectangleF structures differ in location or size.
      void setBottom(float value)
      Gets or sets the y-coordinate that is the sum of Aspose.Imaging.RectangleF.Y and Aspose.Imaging.RectangleF.Height of this Aspose.Imaging.RectangleF structure.
      void setHeight(float value)
      Gets or sets the height of this Aspose.Imaging.RectangleF structure.
      void setLeft(float value)
      Gets or sets the x-coordinate of the left edge of this Aspose.Imaging.RectangleF structure.
      void setLocation(PointF value)
      Gets or sets the coordinates of the upper-left corner of this Aspose.Imaging.RectangleF structure.
      void setRight(float value)
      Gets or sets the x-coordinate that is the sum of Aspose.Imaging.RectangleF.X and Aspose.Imaging.RectangleF.Width of this Aspose.Imaging.RectangleF structure.
      void setSize(SizeF value)
      Gets or sets the size of this Aspose.Imaging.RectangleF.
      void setTop(float value)
      Gets or sets the y-coordinate of the top edge of this Aspose.Imaging.RectangleF structure.
      void setWidth(float value)
      Gets or sets the width of this Aspose.Imaging.RectangleF structure.
      void setX(float value)
      Gets or sets the x-coordinate of the upper-left corner of this Aspose.Imaging.RectangleF structure.
      void setY(float value)
      Gets or sets the y-coordinate of the upper-left corner of this Aspose.Imaging.RectangleF structure.
      static RectangleF to_RectangleF(Rectangle rect)
      Converts the specified Aspose.Imaging.Rectangle structure to a Aspose.Imaging.RectangleF structure.
      String toString()
      Converts the attributes of this Aspose.Imaging.RectangleF to a human-readable string.
      static RectangleF union(RectangleF a, RectangleF b)
      Creates the smallest possible third rectangle that can contain both of two rectangles that form a union.
    • Constructor Detail

      • RectangleF

        public RectangleF()
      • RectangleF

        public RectangleF(float x,
                          float y,
                          float width,
                          float height)

        Initializes a new instance of the Aspose.Imaging.RectangleF structure with the specified location and size.

        Parameters:
        x - The x-coordinate of the upper-left corner of the rectangle.
        y - The y-coordinate of the upper-left corner of the rectangle.
        width - The width of the rectangle.
        height - The height of the rectangle.
      • RectangleF

        public RectangleF(PointF location,
                          SizeF size)

        Initializes a new instance of the Aspose.Imaging.RectangleF structure with the specified location and size.

        Parameters:
        location - A Aspose.Imaging.PointF that represents the upper-left corner of the rectangular region.
        size - A Aspose.Imaging.SizeF that represents the width and height of the rectangular region.
    • Method Detail

      • getEmpty

        public static RectangleF getEmpty()

        Gets a new instance of the Aspose.Imaging.RectangleF structure that has Aspose.Imaging.RectangleF.X, Aspose.Imaging.RectangleF.Y, Aspose.Imaging.RectangleF.Width and Aspose.Imaging.RectangleF.Height values set to zero.

      • getLocation

        public PointF getLocation()

        Gets or sets the coordinates of the upper-left corner of this Aspose.Imaging.RectangleF structure.

        Returns:
        A Aspose.Imaging.PointF that represents the upper-left corner of this Aspose.Imaging.RectangleF structure.
      • setLocation

        public void setLocation(PointF value)

        Gets or sets the coordinates of the upper-left corner of this Aspose.Imaging.RectangleF structure.

      • getSize

        public SizeF getSize()

        Gets or sets the size of this Aspose.Imaging.RectangleF.

        Returns:
        A Aspose.Imaging.SizeF that represents the width and height of this Aspose.Imaging.RectangleF structure.
      • setSize

        public void setSize(SizeF value)

        Gets or sets the size of this Aspose.Imaging.RectangleF.

      • getX

        public float getX()

        Gets or sets the x-coordinate of the upper-left corner of this Aspose.Imaging.RectangleF structure.

        Returns:
        The x-coordinate of the upper-left corner of this Aspose.Imaging.RectangleF structure.
      • setX

        public void setX(float value)

        Gets or sets the x-coordinate of the upper-left corner of this Aspose.Imaging.RectangleF structure.

      • getY

        public float getY()

        Gets or sets the y-coordinate of the upper-left corner of this Aspose.Imaging.RectangleF structure.

        Returns:
        The y-coordinate of the upper-left corner of this Aspose.Imaging.RectangleF structure.
      • setY

        public void setY(float value)

        Gets or sets the y-coordinate of the upper-left corner of this Aspose.Imaging.RectangleF structure.

      • getWidth

        public float getWidth()

        Gets or sets the width of this Aspose.Imaging.RectangleF structure.

        Returns:
        The width of this Aspose.Imaging.RectangleF structure.
      • setWidth

        public void setWidth(float value)

        Gets or sets the width of this Aspose.Imaging.RectangleF structure.

      • getHeight

        public float getHeight()

        Gets or sets the height of this Aspose.Imaging.RectangleF structure.

        Returns:
        The height of this Aspose.Imaging.RectangleF structure.
      • setHeight

        public void setHeight(float value)

        Gets or sets the height of this Aspose.Imaging.RectangleF structure.

      • getLeft

        public float getLeft()

        Gets or sets the x-coordinate of the left edge of this Aspose.Imaging.RectangleF structure.

        Returns:
        The x-coordinate of the left edge of this Aspose.Imaging.RectangleF structure.
      • setLeft

        public void setLeft(float value)

        Gets or sets the x-coordinate of the left edge of this Aspose.Imaging.RectangleF structure.

      • getTop

        public float getTop()

        Gets or sets the y-coordinate of the top edge of this Aspose.Imaging.RectangleF structure.

        Returns:
        The y-coordinate of the top edge of this Aspose.Imaging.RectangleF structure.
      • setTop

        public void setTop(float value)

        Gets or sets the y-coordinate of the top edge of this Aspose.Imaging.RectangleF structure.

      • getRight

        public float getRight()

        Gets or sets the x-coordinate that is the sum of Aspose.Imaging.RectangleF.X and Aspose.Imaging.RectangleF.Width of this Aspose.Imaging.RectangleF structure.

        Returns:
        The x-coordinate that is the sum of Aspose.Imaging.RectangleF.X and Aspose.Imaging.RectangleF.Width of this Aspose.Imaging.RectangleF structure.
      • setRight

        public void setRight(float value)

        Gets or sets the x-coordinate that is the sum of Aspose.Imaging.RectangleF.X and Aspose.Imaging.RectangleF.Width of this Aspose.Imaging.RectangleF structure.

      • getBottom

        public float getBottom()

        Gets or sets the y-coordinate that is the sum of Aspose.Imaging.RectangleF.Y and Aspose.Imaging.RectangleF.Height of this Aspose.Imaging.RectangleF structure.

        Returns:
        The y-coordinate that is the sum of Aspose.Imaging.RectangleF.Y and Aspose.Imaging.RectangleF.Height of this Aspose.Imaging.RectangleF structure.
      • setBottom

        public void setBottom(float value)

        Gets or sets the y-coordinate that is the sum of Aspose.Imaging.RectangleF.Y and Aspose.Imaging.RectangleF.Height of this Aspose.Imaging.RectangleF structure.

      • isEmpty

        public boolean isEmpty()

        Gets a value indicating whether the Aspose.Imaging.RectangleF.Width or Aspose.Imaging.RectangleF.Height property of this Aspose.Imaging.RectangleF has a value of zero.

        Returns:
        This property returns true if the Aspose.Imaging.RectangleF.Width or Aspose.Imaging.RectangleF.Height property of this Aspose.Imaging.RectangleF has a value of zero; otherwise, false.
      • fromPoints

        public static RectangleF fromPoints(PointF point1,
                                            PointF point2)

        Creates a new Rectangle from two points specified. Two verticles of the created Rectangle will be equal to the passed point1 and point2. These would be typically the opposite vertices.

        Parameters:
        point1 - The first Point for the new rectangle.
        point2 - The second Point for the new rectangle.
        Returns:
        A newly created Rectangle.
      • inflate

        public static RectangleF inflate(RectangleF rect,
                                         float x,
                                         float y)

        Creates and returns an inflated copy of the specified Aspose.Imaging.RectangleF structure. The copy is inflated by the specified amount. The original rectangle remains unmodified.

        Parameters:
        rect - The Aspose.Imaging.RectangleF to be copied. This rectangle is not modified.
        x - The amount to inflate the copy of the rectangle horizontally.
        y - The amount to inflate the copy of the rectangle vertically.
        Returns:
        The inflated Aspose.Imaging.RectangleF.
      • intersect

        public static RectangleF intersect(RectangleF a,
                                           RectangleF b)

        Returns a Aspose.Imaging.RectangleF structure that represents the intersection of two rectangles. If there is no intersection, and empty Aspose.Imaging.RectangleF is returned.

        Parameters:
        a - A first rectangle to intersect.
        b - A second rectangle to intersect.
        Returns:
        A third Aspose.Imaging.RectangleF structure the size of which represents the overlapped area of the two specified rectangles.
      • union

        public static RectangleF union(RectangleF a,
                                       RectangleF b)

        Creates the smallest possible third rectangle that can contain both of two rectangles that form a union.

        Parameters:
        a - A first rectangle to union.
        b - A second rectangle to union.
        Returns:
        A third Aspose.Imaging.RectangleF structure that contains both of the two rectangles that form the union.
      • op_Equality

        public static boolean op_Equality(RectangleF left,
                                          RectangleF right)

        Tests whether two Aspose.Imaging.RectangleF structures have equal location and size.

        Parameters:
        left - The Aspose.Imaging.RectangleF structure that is to the left of the equality operator.
        right - The Aspose.Imaging.RectangleF structure that is to the right of the equality operator.
        Returns:
        This operator returns true if the two specified Aspose.Imaging.RectangleF structures have equal Aspose.Imaging.RectangleF.X, Aspose.Imaging.RectangleF.Y, Aspose.Imaging.RectangleF.Width, and Aspose.Imaging.RectangleF.Height properties.
      • op_Inequality

        public static boolean op_Inequality(RectangleF left,
                                            RectangleF right)

        Tests whether two Aspose.Imaging.RectangleF structures differ in location or size.

        Parameters:
        left - The Aspose.Imaging.RectangleF structure that is to the left of the inequality operator.
        right - The Aspose.Imaging.RectangleF structure that is to the right of the inequality operator.
        Returns:
        This operator returns true if any of the Aspose.Imaging.RectangleF.X , Aspose.Imaging.RectangleF.Y, Aspose.Imaging.RectangleF.Width, or Aspose.Imaging.RectangleF.Height properties of the two Aspose.Imaging.RectangleF structures are unequal; otherwise false.
      • to_RectangleF

        public static RectangleF to_RectangleF(Rectangle rect)

        Converts the specified Aspose.Imaging.Rectangle structure to a Aspose.Imaging.RectangleF structure.

        Parameters:
        rect - The Aspose.Imaging.Rectangle structure to convert.
        Returns:
        The Aspose.Imaging.RectangleF structure that is converted from the specified Aspose.Imaging.Rectangle structure.
      • fromLeftTopRightBottom

        public static RectangleF fromLeftTopRightBottom(float left,
                                                        float top,
                                                        float right,
                                                        float bottom)

        Creates a Aspose.Imaging.RectangleF structure with upper-left corner and lower-right corner at the specified locations.

        Parameters:
        left - The x-coordinate of the upper-left corner of the rectangular region.
        top - The y-coordinate of the upper-left corner of the rectangular region.
        right - The x-coordinate of the lower-right corner of the rectangular region.
        bottom - The y-coordinate of the lower-right corner of the rectangular region.
        Returns:
        The new Aspose.Imaging.RectangleF that this method creates.
      • normalize

        public void normalize()

        Normalizes the rectangle by making it's width and height positive, left less than right and top less than bottom.

      • contains

        public boolean contains(float x,
                                float y)

        Determines if the specified point is contained within this Aspose.Imaging.RectangleF structure.

        Parameters:
        x - The x-coordinate of the point to test.
        y - The y-coordinate of the point to test.
        Returns:
        This method returns true if the point defined by x and y is contained within this Aspose.Imaging.RectangleF structure; otherwise false.
      • contains

        public boolean contains(PointF point)

        Determines if the specified point is contained within this Aspose.Imaging.RectangleF structure.

        Parameters:
        point - The Aspose.Imaging.PointF to test.
        Returns:
        This method returns true if the point represented by the point parameter is contained within this Aspose.Imaging.RectangleF structure; otherwise false.
      • contains

        public boolean contains(RectangleF rect)

        Determines if the rectangular region represented by rect is entirely contained within this Aspose.Imaging.RectangleF structure.

        Parameters:
        rect - The Aspose.Imaging.RectangleF to test.
        Returns:
        This method returns true if the rectangular region represented by rect is entirely contained within the rectangular region represented by this Aspose.Imaging.RectangleF; otherwise false.
      • inflate

        public void inflate(float x,
                            float y)

        Inflates this Aspose.Imaging.RectangleF structure by the specified amount.

        Parameters:
        x - The amount to inflate this Aspose.Imaging.RectangleF structure horizontally.
        y - The amount to inflate this Aspose.Imaging.RectangleF structure vertically.
      • inflate

        public void inflate(SizeF size)

        Inflates this Aspose.Imaging.RectangleF by the specified amount.

        Parameters:
        size - The amount to inflate this rectangle.
      • intersect

        public void intersect(RectangleF rect)

        Replaces this Aspose.Imaging.RectangleF structure with the intersection of itself and the specified Aspose.Imaging.RectangleF structure.

        Parameters:
        rect - The rectangle to intersect.
      • intersectsWith

        public boolean intersectsWith(RectangleF rect)

        Determines if this rectangle intersects with rect.

        Parameters:
        rect - The rectangle to test.
        Returns:
        This method returns true if there is any intersection.
      • offset

        public void offset(PointF pos)

        Adjusts the location of this rectangle by the specified amount.

        Parameters:
        pos - The amount to offset the location.
      • offset

        public void offset(float x,
                           float y)

        Adjusts the location of this rectangle by the specified amount.

        Parameters:
        x - The amount to offset the location horizontally.
        y - The amount to offset the location vertically.
      • equals

        public boolean equals(Object obj)

        Tests whether obj is a Aspose.Imaging.RectangleF with the same location and size of this Aspose.Imaging.RectangleF.

        Overrides:
        equals in class Object
        Parameters:
        obj - The System.Object to test.
        Returns:
        This method returns true if obj is a Aspose.Imaging.RectangleF and its X, Y, Width, and Height properties are equal to the corresponding properties of this Aspose.Imaging.RectangleF; otherwise, false.
      • hashCode

        public int hashCode()

        Gets the hash code for this Aspose.Imaging.RectangleF structure.

        Overrides:
        hashCode in class Object
        Returns:
        The hash code for this Aspose.Imaging.RectangleF.
      • toString

        public String toString()

        Converts the attributes of this Aspose.Imaging.RectangleF to a human-readable string.

        Overrides:
        toString in class Object
        Returns:
        A string that contains the position, width, and height of this Aspose.Imaging.RectangleF structure.
      • CloneTo

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

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