Packages

 

com.aspose.psd

Interfaces

Classes

Exceptions

com.aspose.psd

Class Region



  • public final class Region
    extends Object

    Describes the interior of a graphics shape composed of rectangles and paths. This class cannot be inherited.

    • Constructor Summary

      Constructors 
      Constructor and Description
      Region()
      Initializes a new T:Aspose.Imaging.Region.
      Region(GraphicsPath path)
      Initializes a new T:Aspose.Imaging.Region with the specified T:Aspose.Imaging.GraphicsPath.
      Region(Rectangle rect)
      Initializes a new T:Aspose.Imaging.Region from the specified T:Aspose.Imaging.Rectangle structure.
      Region(RectangleF rect)
      Initializes a new T:Aspose.Imaging.Region from the specified T:Aspose.Imaging.RectangleF structure.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void complement(GraphicsPath path)
      Updates this com.aspose.psd.Region to contain the portion of the specified com.aspose.psd.GraphicsPath that does not intersect with this com.aspose.psd.region.
      void complement(Rectangle rect)
      Updates this com.aspose.psd.Region to contain the portion of the specified com.aspose.psd.Rectangle structure that does not intersect with this com.aspose.psd.region.
      void complement(RectangleF rect)
      Updates this com.aspose.psd.Region to contain the portion of the specified com.aspose.psd.RectangleF structure that does not intersect with this com.aspose.psd.region.
      void complement(Region region)
      Updates this com.aspose.psd.Region to contain the portion of the specified com.aspose.psd.Region that does not intersect with this com.aspose.psd.region.
      Region deepClone()
      Creates an exact deep copy of this com.aspose.psd.region.
      void exclude(GraphicsPath path)
      Updates this com.aspose.psd.Region to contain only the portion of its interior that does not intersect with the specified com.aspose.psd.graphicsPath.
      void exclude(Rectangle rect)
      Updates this com.aspose.psd.Region to contain only the portion of its interior that does not intersect with the specified com.aspose.psd.Rectangle structure.
      void exclude(RectangleF rect)
      Updates this com.aspose.psd.Region to contain only the portion of its interior that does not intersect with the specified com.aspose.psd.RectangleF structure.
      void exclude(Region region)
      Updates this com.aspose.psd.Region to contain only the portion of its interior that does not intersect with the specified com.aspose.psd.region.
      void intersect(GraphicsPath path)
      Updates this com.aspose.psd.Region to the intersection of itself with the specified com.aspose.psd.graphicsPath.
      void intersect(Rectangle rect)
      Updates this com.aspose.psd.Region to the intersection of itself with the specified com.aspose.psd.Rectangle structure.
      void intersect(RectangleF rect)
      Updates this com.aspose.psd.Region to the intersection of itself with the specified com.aspose.psd.RectangleF structure.
      void intersect(Region region)
      Updates this com.aspose.psd.Region to the intersection of itself with the specified com.aspose.psd.region.
      boolean isEmpty(Graphics g)
      Tests whether this com.aspose.psd.Region has an empty interior on the specified drawing surface.
      boolean isEquals(Region region, Graphics g)
      Tests whether the specified com.aspose.psd.Region is identical to this com.aspose.psd.Region on the specified drawing surface.
      boolean isInfinite(Graphics g)
      Tests whether this com.aspose.psd.Region has an infinite interior on the specified drawing surface.
      boolean isVisible(float x, float y)
      Tests whether the specified point is contained within this com.aspose.psd.region.
      boolean isVisible(float x, float y, float width, float height)
      Tests whether any portion of the specified rectangle is contained within this com.aspose.psd.region.
      boolean isVisible(float x, float y, float width, float height, Graphics g)
      Tests whether any portion of the specified rectangle is contained within this com.aspose.psd.Region when drawn using the specified com.aspose.psd.graphics.
      boolean isVisible(float x, float y, Graphics g)
      Tests whether the specified point is contained within this com.aspose.psd.Region when drawn using the specified com.aspose.psd.graphics.
      boolean isVisible(int x, int y, Graphics g)
      Tests whether the specified point is contained within this com.aspose.psd.Region object when drawn using the specified com.aspose.psd.Graphics object.
      boolean isVisible(int x, int y, int width, int height)
      Tests whether any portion of the specified rectangle is contained within this com.aspose.psd.region.
      boolean isVisible(int x, int y, int width, int height, Graphics g)
      Tests whether any portion of the specified rectangle is contained within this com.aspose.psd.Region when drawn using the specified com.aspose.psd.graphics.
      boolean isVisible(Point point)
      Tests whether the specified com.aspose.psd.Point structure is contained within this com.aspose.psd.region.
      boolean isVisible(PointF point)
      Tests whether the specified com.aspose.psd.PointF structure is contained within this com.aspose.psd.region.
      boolean isVisible(PointF point, Graphics g)
      Tests whether the specified com.aspose.psd.PointF structure is contained within this com.aspose.psd.Region when drawn using the specified com.aspose.psd.graphics.
      boolean isVisible(Point point, Graphics g)
      Tests whether the specified com.aspose.psd.Point structure is contained within this com.aspose.psd.Region when drawn using the specified com.aspose.psd.graphics.
      boolean isVisible(Rectangle rect)
      Tests whether any portion of the specified com.aspose.psd.Rectangle structure is contained within this com.aspose.psd.region.
      boolean isVisible(RectangleF rect)
      Tests whether any portion of the specified com.aspose.psd.RectangleF structure is contained within this com.aspose.psd.region.
      boolean isVisible(RectangleF rect, Graphics g)
      Tests whether any portion of the specified com.aspose.psd.RectangleF structure is contained within this com.aspose.psd.Region when drawn using the specified com.aspose.psd.graphics.
      boolean isVisible(Rectangle rect, Graphics g)
      Tests whether any portion of the specified com.aspose.psd.Rectangle structure is contained within this com.aspose.psd.Region when drawn using the specified com.aspose.psd.graphics.
      void makeEmpty()
      Initializes this com.aspose.psd.Region to an empty interior.
      void makeInfinite()
      Initializes this com.aspose.psd.Region object to an infinite interior.
      void transform(Matrix matrix)
      Transforms this com.aspose.psd.Region by the specified com.aspose.psd.matrix.
      void translate(float dx, float dy)
      Offsets the coordinates of this com.aspose.psd.Region by the specified amount.
      void translate(int dx, int dy)
      Offsets the coordinates of this com.aspose.psd.Region by the specified amount.
      void union(GraphicsPath path)
      Updates this com.aspose.psd.Region to the union of itself and the specified com.aspose.psd.graphicsPath.
      void union(Rectangle rect)
      Updates this com.aspose.psd.Region to the union of itself and the specified com.aspose.psd.Rectangle structure.
      void union(RectangleF rect)
      Updates this com.aspose.psd.Region to the union of itself and the specified com.aspose.psd.RectangleF structure.
      void union(Region region)
      Updates this com.aspose.psd.Region to the union of itself and the specified com.aspose.psd.region.
      void xor(GraphicsPath path)
      Updates this com.aspose.psd.Region to the union minus the intersection of itself with the specified com.aspose.psd.graphicsPath.
      void xor(Rectangle rect)
      Updates this com.aspose.psd.Region to the union minus the intersection of itself with the specified com.aspose.psd.Rectangle structure.
      void xor(RectangleF rect)
      Updates this com.aspose.psd.Region to the union minus the intersection of itself with the specified com.aspose.psd.RectangleF structure.
      void xor(Region region)
      Updates this com.aspose.psd.Region to the union minus the intersection of itself with the specified com.aspose.psd.region.
    • Constructor Detail

      • Region

        public Region()

        Initializes a new T:Aspose.Imaging.Region.

      • Region

        public Region(RectangleF rect)

        Initializes a new T:Aspose.Imaging.Region from the specified T:Aspose.Imaging.RectangleF structure.

        Parameters:
        rect - A T:Aspose.Imaging.RectangleF structure that defines the interior of the new T:Aspose.Imaging.Region.
      • Region

        public Region(Rectangle rect)

        Initializes a new T:Aspose.Imaging.Region from the specified T:Aspose.Imaging.Rectangle structure.

        Parameters:
        rect - A T:Aspose.Imaging.Rectangle structure that defines the interior of the new T:Aspose.Imaging.Region.
      • Region

        public Region(GraphicsPath path)

        Initializes a new T:Aspose.Imaging.Region with the specified T:Aspose.Imaging.GraphicsPath.

        Parameters:
        path - A T:Aspose.Imaging.GraphicsPath that defines the new T:Aspose.Imaging.Region.
        Throws:
        com.aspose.ms.System.ArgumentNullException - path is null.
    • Method Detail

      • deepClone

        public Region deepClone()

        Creates an exact deep copy of this com.aspose.psd.region.

        Returns:
        The com.aspose.psd.Region that this method creates.
      • makeInfinite

        public void makeInfinite()

        Initializes this com.aspose.psd.Region object to an infinite interior.

      • makeEmpty

        public void makeEmpty()

        Initializes this com.aspose.psd.Region to an empty interior.

      • intersect

        public void intersect(RectangleF rect)

        Updates this com.aspose.psd.Region to the intersection of itself with the specified com.aspose.psd.RectangleF structure.

        Parameters:
        rect - The com.aspose.psd.RectangleF structure to intersect with this com.aspose.psd.region.
      • intersect

        public void intersect(Rectangle rect)

        Updates this com.aspose.psd.Region to the intersection of itself with the specified com.aspose.psd.Rectangle structure.

        Parameters:
        rect - The com.aspose.psd.Rectangle structure to intersect with this com.aspose.psd.region.
      • intersect

        public void intersect(GraphicsPath path)

        Updates this com.aspose.psd.Region to the intersection of itself with the specified com.aspose.psd.graphicsPath.

        Parameters:
        path - The com.aspose.psd.GraphicsPath to intersect with this com.aspose.psd.region.
      • intersect

        public void intersect(Region region)

        Updates this com.aspose.psd.Region to the intersection of itself with the specified com.aspose.psd.region.

        Parameters:
        region - The com.aspose.psd.Region to intersect with this com.aspose.psd.region.
      • union

        public void union(RectangleF rect)

        Updates this com.aspose.psd.Region to the union of itself and the specified com.aspose.psd.RectangleF structure.

        Parameters:
        rect - The com.aspose.psd.RectangleF structure to unite with this com.aspose.psd.region.
      • union

        public void union(Rectangle rect)

        Updates this com.aspose.psd.Region to the union of itself and the specified com.aspose.psd.Rectangle structure.

        Parameters:
        rect - The com.aspose.psd.Rectangle structure to unite with this com.aspose.psd.region.
      • union

        public void union(GraphicsPath path)

        Updates this com.aspose.psd.Region to the union of itself and the specified com.aspose.psd.graphicsPath.

        Parameters:
        path - The com.aspose.psd.GraphicsPath to unite with this com.aspose.psd.region.
        Throws:
        com.aspose.ms.System.ArgumentNullException - path is null.
      • union

        public void union(Region region)

        Updates this com.aspose.psd.Region to the union of itself and the specified com.aspose.psd.region.

        Parameters:
        region - The com.aspose.psd.Region to unite with this com.aspose.psd.region.
        Throws:
        com.aspose.ms.System.ArgumentNullException - region is null.
      • xor

        public void xor(RectangleF rect)

        Updates this com.aspose.psd.Region to the union minus the intersection of itself with the specified com.aspose.psd.RectangleF structure.

        Parameters:
        rect - The com.aspose.psd.RectangleF structure to xor with this com.aspose.psd.region.
      • xor

        public void xor(Rectangle rect)

        Updates this com.aspose.psd.Region to the union minus the intersection of itself with the specified com.aspose.psd.Rectangle structure.

        Parameters:
        rect - The com.aspose.psd.Rectangle structure to xor with this com.aspose.psd.region.
      • xor

        public void xor(GraphicsPath path)

        Updates this com.aspose.psd.Region to the union minus the intersection of itself with the specified com.aspose.psd.graphicsPath.

        Parameters:
        path - The com.aspose.psd.GraphicsPath to xor with this com.aspose.psd.region.
        Throws:
        com.aspose.ms.System.ArgumentNullException - path is null.
      • xor

        public void xor(Region region)

        Updates this com.aspose.psd.Region to the union minus the intersection of itself with the specified com.aspose.psd.region.

        Parameters:
        region - The com.aspose.psd.Region to xor with this com.aspose.psd.region.
        Throws:
        com.aspose.ms.System.ArgumentNullException - region is null.
      • exclude

        public void exclude(RectangleF rect)

        Updates this com.aspose.psd.Region to contain only the portion of its interior that does not intersect with the specified com.aspose.psd.RectangleF structure.

        Parameters:
        rect - The com.aspose.psd.RectangleF structure to exclude from this com.aspose.psd.region.
      • exclude

        public void exclude(Rectangle rect)

        Updates this com.aspose.psd.Region to contain only the portion of its interior that does not intersect with the specified com.aspose.psd.Rectangle structure.

        Parameters:
        rect - The com.aspose.psd.Rectangle structure to exclude from this com.aspose.psd.region.
      • exclude

        public void exclude(GraphicsPath path)

        Updates this com.aspose.psd.Region to contain only the portion of its interior that does not intersect with the specified com.aspose.psd.graphicsPath.

        Parameters:
        path - The com.aspose.psd.GraphicsPath to exclude from this com.aspose.psd.region.
        Throws:
        com.aspose.ms.System.ArgumentNullException - path is null.
      • exclude

        public void exclude(Region region)

        Updates this com.aspose.psd.Region to contain only the portion of its interior that does not intersect with the specified com.aspose.psd.region.

        Parameters:
        region - The com.aspose.psd.Region to exclude from this com.aspose.psd.region.
        Throws:
        com.aspose.ms.System.ArgumentNullException - region is null.
      • complement

        public void complement(RectangleF rect)

        Updates this com.aspose.psd.Region to contain the portion of the specified com.aspose.psd.RectangleF structure that does not intersect with this com.aspose.psd.region.

        Parameters:
        rect - The com.aspose.psd.RectangleF structure to complement this com.aspose.psd.region.
      • complement

        public void complement(Rectangle rect)

        Updates this com.aspose.psd.Region to contain the portion of the specified com.aspose.psd.Rectangle structure that does not intersect with this com.aspose.psd.region.

        Parameters:
        rect - The com.aspose.psd.Rectangle structure to complement this com.aspose.psd.region.
      • complement

        public void complement(GraphicsPath path)

        Updates this com.aspose.psd.Region to contain the portion of the specified com.aspose.psd.GraphicsPath that does not intersect with this com.aspose.psd.region.

        Parameters:
        path - The com.aspose.psd.GraphicsPath to complement this com.aspose.psd.region.
        Throws:
        com.aspose.ms.System.ArgumentNullException - path isnull.
      • complement

        public void complement(Region region)

        Updates this com.aspose.psd.Region to contain the portion of the specified com.aspose.psd.Region that does not intersect with this com.aspose.psd.region.

        Parameters:
        region - The com.aspose.psd.Region object to complement this com.aspose.psd.Region object.
        Throws:
        com.aspose.ms.System.ArgumentNullException - region isnull.
      • translate

        public void translate(float dx,
                              float dy)

        Offsets the coordinates of this com.aspose.psd.Region by the specified amount.

        Parameters:
        dx - The amount to offset this com.aspose.psd.Region horizontally.
        dy - The amount to offset this com.aspose.psd.Region vertically.
      • translate

        public void translate(int dx,
                              int dy)

        Offsets the coordinates of this com.aspose.psd.Region by the specified amount.

        Parameters:
        dx - The amount to offset this com.aspose.psd.Region horizontally.
        dy - The amount to offset this com.aspose.psd.Region vertically.
      • transform

        public void transform(Matrix matrix)

        Transforms this com.aspose.psd.Region by the specified com.aspose.psd.matrix.

        Parameters:
        matrix - The com.aspose.psd.Matrix by which to transform this com.aspose.psd.region.
        Throws:
        com.aspose.ms.System.ArgumentNullException - matrix is null.
      • isEmpty

        public boolean isEmpty(Graphics g)

        Tests whether this com.aspose.psd.Region has an empty interior on the specified drawing surface.

        Parameters:
        g - A com.aspose.psd.Graphics that represents a drawing surface.
        Returns:
        true if the interior of this com.aspose.psd.Region is empty when the transformation associated with g is applied; otherwise, false.
        Throws:
        com.aspose.ms.System.ArgumentNullException - g is null.
      • isInfinite

        public boolean isInfinite(Graphics g)

        Tests whether this com.aspose.psd.Region has an infinite interior on the specified drawing surface.

        Parameters:
        g - A com.aspose.psd.Graphics that represents a drawing surface.
        Returns:
        true if the interior of this com.aspose.psd.Region is infinite when the transformation associated with g is applied; otherwise, false.
        Throws:
        com.aspose.ms.System.ArgumentNullException - g is null.
      • isEquals

        public boolean isEquals(Region region,
                                Graphics g)

        Tests whether the specified com.aspose.psd.Region is identical to this com.aspose.psd.Region on the specified drawing surface.

        Parameters:
        region - The com.aspose.psd.Region to test.
        g - A com.aspose.psd.Graphics that represents a drawing surface.
        Returns:
        True if the interior of region is identical to the interior of this region when the transformation associated with the g parameter is applied; otherwise, false.
        Throws:
        com.aspose.ms.System.ArgumentNullException - g orregion is null.
      • isVisible

        public boolean isVisible(float x,
                                 float y)

        Tests whether the specified point is contained within this com.aspose.psd.region.

        Parameters:
        x - The x-coordinate of the point to test.
        y - The y-coordinate of the point to test.
        Returns:
        True when the specified point is contained within this com.aspose.psd.Region; otherwise, false.
      • isVisible

        public boolean isVisible(PointF point)

        Tests whether the specified com.aspose.psd.PointF structure is contained within this com.aspose.psd.region.

        Parameters:
        point - The com.aspose.psd.PointF structure to test.
        Returns:
        true when point is contained within this com.aspose.psd.Region; otherwise, false.
      • isVisible

        public boolean isVisible(float x,
                                 float y,
                                 Graphics g)

        Tests whether the specified point is contained within this com.aspose.psd.Region when drawn using the specified com.aspose.psd.graphics.

        Parameters:
        x - The x-coordinate of the point to test.
        y - The y-coordinate of the point to test.
        g - A com.aspose.psd.Graphics that represents a graphics context.
        Returns:
        True when the specified point is contained within this com.aspose.psd.Region; otherwise, false.
      • isVisible

        public boolean isVisible(PointF point,
                                 Graphics g)

        Tests whether the specified com.aspose.psd.PointF structure is contained within this com.aspose.psd.Region when drawn using the specified com.aspose.psd.graphics.

        Parameters:
        point - The com.aspose.psd.PointF structure to test.
        g - A com.aspose.psd.Graphics that represents a graphics context.
        Returns:
        true when point is contained within this com.aspose.psd.Region; otherwise, false.
      • isVisible

        public boolean isVisible(float x,
                                 float y,
                                 float width,
                                 float height)

        Tests whether any portion of the specified rectangle is contained within this com.aspose.psd.region.

        Parameters:
        x - The x-coordinate of the upper-left corner of the rectangle to test.
        y - The y-coordinate of the upper-left corner of the rectangle to test.
        width - The width of the rectangle to test.
        height - The height of the rectangle to test.
        Returns:
        true when any portion of the specified rectangle is contained within this com.aspose.psd.Region object; otherwise, false.
      • isVisible

        public boolean isVisible(RectangleF rect)

        Tests whether any portion of the specified com.aspose.psd.RectangleF structure is contained within this com.aspose.psd.region.

        Parameters:
        rect - The com.aspose.psd.RectangleF structure to test.
        Returns:
        true when any portion of rect is contained within this com.aspose.psd.Region; otherwise, false.
      • isVisible

        public boolean isVisible(float x,
                                 float y,
                                 float width,
                                 float height,
                                 Graphics g)

        Tests whether any portion of the specified rectangle is contained within this com.aspose.psd.Region when drawn using the specified com.aspose.psd.graphics.

        Parameters:
        x - The x-coordinate of the upper-left corner of the rectangle to test.
        y - The y-coordinate of the upper-left corner of the rectangle to test.
        width - The width of the rectangle to test.
        height - The height of the rectangle to test.
        g - A com.aspose.psd.Graphics that represents a graphics context.
        Returns:
        true when any portion of the specified rectangle is contained within this com.aspose.psd.Region; otherwise, false.
      • isVisible

        public boolean isVisible(RectangleF rect,
                                 Graphics g)

        Tests whether any portion of the specified com.aspose.psd.RectangleF structure is contained within this com.aspose.psd.Region when drawn using the specified com.aspose.psd.graphics.

        Parameters:
        rect - The com.aspose.psd.RectangleF structure to test.
        g - A com.aspose.psd.Graphics that represents a graphics context.
        Returns:
        true when rect is contained within this com.aspose.psd.Region; otherwise, false.
      • isVisible

        public boolean isVisible(int x,
                                 int y,
                                 Graphics g)

        Tests whether the specified point is contained within this com.aspose.psd.Region object when drawn using the specified com.aspose.psd.Graphics object.

        Parameters:
        x - The x-coordinate of the point to test.
        y - The y-coordinate of the point to test.
        g - A com.aspose.psd.Graphics that represents a graphics context.
        Returns:
        true when the specified point is contained within this com.aspose.psd.Region; otherwise, false.
      • isVisible

        public boolean isVisible(Point point)

        Tests whether the specified com.aspose.psd.Point structure is contained within this com.aspose.psd.region.

        Parameters:
        point - The com.aspose.psd.Point structure to test.
        Returns:
        true when point is contained within this com.aspose.psd.Region; otherwise, false.
      • isVisible

        public boolean isVisible(Point point,
                                 Graphics g)

        Tests whether the specified com.aspose.psd.Point structure is contained within this com.aspose.psd.Region when drawn using the specified com.aspose.psd.graphics.

        Parameters:
        point - The com.aspose.psd.Point structure to test.
        g - A com.aspose.psd.Graphics that represents a graphics context.
        Returns:
        true when point is contained within this com.aspose.psd.Region; otherwise, false.
      • isVisible

        public boolean isVisible(int x,
                                 int y,
                                 int width,
                                 int height)

        Tests whether any portion of the specified rectangle is contained within this com.aspose.psd.region.

        Parameters:
        x - The x-coordinate of the upper-left corner of the rectangle to test.
        y - The y-coordinate of the upper-left corner of the rectangle to test.
        width - The width of the rectangle to test.
        height - The height of the rectangle to test.
        Returns:
        true when any portion of the specified rectangle is contained within this com.aspose.psd.Region; otherwise, false.
      • isVisible

        public boolean isVisible(Rectangle rect)

        Tests whether any portion of the specified com.aspose.psd.Rectangle structure is contained within this com.aspose.psd.region.

        Parameters:
        rect - The com.aspose.psd.Rectangle structure to test.
        Returns:
        This method returns true when any portion of rect is contained within this com.aspose.psd.Region; otherwise, false.
      • isVisible

        public boolean isVisible(int x,
                                 int y,
                                 int width,
                                 int height,
                                 Graphics g)

        Tests whether any portion of the specified rectangle is contained within this com.aspose.psd.Region when drawn using the specified com.aspose.psd.graphics.

        Parameters:
        x - The x-coordinate of the upper-left corner of the rectangle to test.
        y - The y-coordinate of the upper-left corner of the rectangle to test.
        width - The width of the rectangle to test.
        height - The height of the rectangle to test.
        g - A com.aspose.psd.Graphics that represents a graphics context.
        Returns:
        true when any portion of the specified rectangle is contained within this com.aspose.psd.Region; otherwise, false.
      • isVisible

        public boolean isVisible(Rectangle rect,
                                 Graphics g)

        Tests whether any portion of the specified com.aspose.psd.Rectangle structure is contained within this com.aspose.psd.Region when drawn using the specified com.aspose.psd.graphics.

        Parameters:
        rect - The com.aspose.psd.Rectangle structure to test.
        g - A com.aspose.psd.Graphics that represents a graphics context.
        Returns:
        true when any portion of the rect is contained within this com.aspose.psd.Region; otherwise, false.