com.aspose.imaging
Class Region

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

public final class Region
extends java.lang.Object

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


Constructor Summary
Region()
           Initializes a new com.aspose.imaging.Region.
Region(GraphicsPath path)
           Initializes a new com.aspose.imaging.Region with the specified com.aspose.imaging.GraphicsPath.
Region(Rectangle rect)
           Initializes a new com.aspose.imaging.Region from the specified com.aspose.imaging.Rectangle structure.
Region(RectangleF rect)
           Initializes a new com.aspose.imaging.Region from the specified com.aspose.imaging.RectangleF structure.
 
Method Summary
 void complement(GraphicsPath path)
           Updates this com.aspose.imaging.Region to contain the portion of the specified com.aspose.imaging.GraphicsPath that does not intersect with this com.aspose.imaging.Region.
 void complement(Rectangle rect)
           Updates this com.aspose.imaging.Region to contain the portion of the specified com.aspose.imaging.Rectangle structure that does not intersect with this com.aspose.imaging.Region.
 void complement(RectangleF rect)
           Updates this com.aspose.imaging.Region to contain the portion of the specified com.aspose.imaging.RectangleF structure that does not intersect with this com.aspose.imaging.Region.
 void complement(Region region)
           Updates this com.aspose.imaging.Region to contain the portion of the specified com.aspose.imaging.Region that does not intersect with this com.aspose.imaging.Region.
 Region deepClone()
           Creates an exact deep copy of this com.aspose.imaging.Region.
 boolean equals(Region region, Graphics g)
           Tests whether the specified com.aspose.imaging.Region is identical to this com.aspose.imaging.Region on the specified drawing surface.
 void exclude(GraphicsPath path)
           Updates this com.aspose.imaging.Region to contain only the portion of its interior that does not intersect with the specified com.aspose.imaging.GraphicsPath.
 void exclude(Rectangle rect)
           Updates this com.aspose.imaging.Region to contain only the portion of its interior that does not intersect with the specified com.aspose.imaging.Rectangle structure.
 void exclude(RectangleF rect)
           Updates this com.aspose.imaging.Region to contain only the portion of its interior that does not intersect with the specified com.aspose.imaging.RectangleF structure.
 void exclude(Region region)
           Updates this com.aspose.imaging.Region to contain only the portion of its interior that does not intersect with the specified com.aspose.imaging.Region.
 RegionAction[] getActions()
           Gets the region actions.
 void intersect(GraphicsPath path)
           Updates this com.aspose.imaging.Region to the intersection of itself with the specified com.aspose.imaging.GraphicsPath.
 void intersect(Rectangle rect)
           Updates this com.aspose.imaging.Region to the intersection of itself with the specified com.aspose.imaging.Rectangle structure.
 void intersect(RectangleF rect)
           Updates this com.aspose.imaging.Region to the intersection of itself with the specified com.aspose.imaging.RectangleF structure.
 void intersect(Region region)
           Updates this com.aspose.imaging.Region to the intersection of itself with the specified com.aspose.imaging.Region.
 boolean isEmpty(Graphics g)
           Tests whether this com.aspose.imaging.Region has an empty interior on the specified drawing surface.
 boolean isInfinite(Graphics g)
           Tests whether this com.aspose.imaging.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.imaging.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.imaging.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.imaging.Region when drawn using the specified com.aspose.imaging.Graphics.
 boolean isVisible(float x, float y, Graphics g)
           Tests whether the specified point is contained within this com.aspose.imaging.Region when drawn using the specified com.aspose.imaging.Graphics.
 boolean isVisible(int x, int y, Graphics g)
           Tests whether the specified point is contained within this com.aspose.imaging.Region object when drawn using the specified com.aspose.imaging.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.imaging.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.imaging.Region when drawn using the specified com.aspose.imaging.Graphics.
 boolean isVisible(Point point)
           Tests whether the specified com.aspose.imaging.Point structure is contained within this com.aspose.imaging.Region.
 boolean isVisible(PointF point)
           Tests whether the specified com.aspose.imaging.PointF structure is contained within this com.aspose.imaging.Region.
 boolean isVisible(PointF point, Graphics g)
           Tests whether the specified com.aspose.imaging.PointF structure is contained within this com.aspose.imaging.Region when drawn using the specified com.aspose.imaging.Graphics.
 boolean isVisible(Point point, Graphics g)
           Tests whether the specified com.aspose.imaging.Point structure is contained within this com.aspose.imaging.Region when drawn using the specified com.aspose.imaging.Graphics.
 boolean isVisible(Rectangle rect)
           Tests whether any portion of the specified com.aspose.imaging.Rectangle structure is contained within this com.aspose.imaging.Region.
 boolean isVisible(RectangleF rect)
           Tests whether any portion of the specified com.aspose.imaging.RectangleF structure is contained within this com.aspose.imaging.Region.
 boolean isVisible(RectangleF rect, Graphics g)
           Tests whether any portion of the specified com.aspose.imaging.RectangleF structure is contained within this com.aspose.imaging.Region when drawn using the specified com.aspose.imaging.Graphics.
 boolean isVisible(Rectangle rect, Graphics g)
           Tests whether any portion of the specified com.aspose.imaging.Rectangle structure is contained within this com.aspose.imaging.Region when drawn using the specified com.aspose.imaging.Graphics.
 void makeEmpty()
           Initializes this com.aspose.imaging.Region to an empty interior.
 void makeInfinite()
           Initializes this com.aspose.imaging.Region object to an infinite interior.
 void transform(Matrix matrix)
           Transforms this com.aspose.imaging.Region by the specified com.aspose.imaging.Matrix.
 void translate(float dx, float dy)
           Offsets the coordinates of this com.aspose.imaging.Region by the specified amount.
 void translate(int dx, int dy)
           Offsets the coordinates of this com.aspose.imaging.Region by the specified amount.
 void union(GraphicsPath path)
           Updates this com.aspose.imaging.Region to the union of itself and the specified com.aspose.imaging.GraphicsPath.
 void union(Rectangle rect)
           Updates this com.aspose.imaging.Region to the union of itself and the specified com.aspose.imaging.Rectangle structure.
 void union(RectangleF rect)
           Updates this com.aspose.imaging.Region to the union of itself and the specified com.aspose.imaging.RectangleF structure.
 void union(Region region)
           Updates this com.aspose.imaging.Region to the union of itself and the specified com.aspose.imaging.Region.
 void xor(GraphicsPath path)
           Updates this com.aspose.imaging.Region to the union minus the intersection of itself with the specified com.aspose.imaging.GraphicsPath.
 void xor(Rectangle rect)
           Updates this com.aspose.imaging.Region to the union minus the intersection of itself with the specified com.aspose.imaging.Rectangle structure.
 void xor(RectangleF rect)
           Updates this com.aspose.imaging.Region to the union minus the intersection of itself with the specified com.aspose.imaging.RectangleF structure.
 void xor(Region region)
           Updates this com.aspose.imaging.Region to the union minus the intersection of itself with the specified com.aspose.imaging.Region.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Region

public Region()

Initializes a new com.aspose.imaging.Region.


Region

public Region(GraphicsPath path)

Initializes a new com.aspose.imaging.Region with the specified com.aspose.imaging.GraphicsPath.


Region

public Region(Rectangle rect)

Initializes a new com.aspose.imaging.Region from the specified com.aspose.imaging.Rectangle structure.

Parameters:
rect - A com.aspose.imaging.Rectangle structure that defines the interior of the new com.aspose.imaging.Region.

Region

public Region(RectangleF rect)

Initializes a new com.aspose.imaging.Region from the specified com.aspose.imaging.RectangleF structure.

Parameters:
rect - A com.aspose.imaging.RectangleF structure that defines the interior of the new com.aspose.imaging.Region.
Method Detail

complement

public void complement(GraphicsPath path)

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


complement

public void complement(Rectangle rect)

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

Parameters:
rect - The com.aspose.imaging.Rectangle structure to complement this com.aspose.imaging.Region.

complement

public void complement(RectangleF rect)

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

Parameters:
rect - The com.aspose.imaging.RectangleF structure to complement this com.aspose.imaging.Region.

complement

public void complement(Region region)

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


deepClone

public Region deepClone()

Creates an exact deep copy of this com.aspose.imaging.Region.

Returns:
The com.aspose.imaging.Region that this method creates.

equals

public boolean equals(Region region,
                      Graphics g)

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


exclude

public void exclude(GraphicsPath path)

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


exclude

public void exclude(Rectangle rect)

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

Parameters:
rect - The com.aspose.imaging.Rectangle structure to exclude from this com.aspose.imaging.Region.

exclude

public void exclude(RectangleF rect)

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

Parameters:
rect - The com.aspose.imaging.RectangleF structure to exclude from this com.aspose.imaging.Region.

exclude

public void exclude(Region region)

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


getActions

public RegionAction[] getActions()

Gets the region actions.

Value: The region actions.


intersect

public void intersect(GraphicsPath path)

Updates this com.aspose.imaging.Region to the intersection of itself with the specified com.aspose.imaging.GraphicsPath.

Parameters:
path - The com.aspose.imaging.GraphicsPath to intersect with this com.aspose.imaging.Region.

intersect

public void intersect(Rectangle rect)

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

Parameters:
rect - The com.aspose.imaging.Rectangle structure to intersect with this com.aspose.imaging.Region.

intersect

public void intersect(RectangleF rect)

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

Parameters:
rect - The com.aspose.imaging.RectangleF structure to intersect with this com.aspose.imaging.Region.

intersect

public void intersect(Region region)

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

Parameters:
region - The com.aspose.imaging.Region to intersect with this com.aspose.imaging.Region.

isEmpty

public boolean isEmpty(Graphics g)

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


isInfinite

public boolean isInfinite(Graphics g)

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


isVisible

public boolean isVisible(float x,
                         float y)

Tests whether the specified point is contained within this com.aspose.imaging.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.imaging.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.imaging.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.imaging.Region object; 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.imaging.Region when drawn using the specified com.aspose.imaging.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.imaging.Graphics that represents a graphics context.
Returns:
true when any portion of the specified rectangle is contained within this com.aspose.imaging.Region; otherwise, false.

isVisible

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

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

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

isVisible

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

Tests whether the specified point is contained within this com.aspose.imaging.Region object when drawn using the specified com.aspose.imaging.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.imaging.Graphics that represents a graphics context.
Returns:
true when the specified point is contained within this com.aspose.imaging.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.imaging.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.imaging.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.imaging.Region when drawn using the specified com.aspose.imaging.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.imaging.Graphics that represents a graphics context.
Returns:
true when any portion of the specified rectangle is contained within this com.aspose.imaging.Region; otherwise, false.

isVisible

public boolean isVisible(Point point)

Tests whether the specified com.aspose.imaging.Point structure is contained within this com.aspose.imaging.Region.

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

isVisible

public boolean isVisible(PointF point)

Tests whether the specified com.aspose.imaging.PointF structure is contained within this com.aspose.imaging.Region.

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

isVisible

public boolean isVisible(PointF point,
                         Graphics g)

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

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

isVisible

public boolean isVisible(Point point,
                         Graphics g)

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

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

isVisible

public boolean isVisible(Rectangle rect)

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

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

isVisible

public boolean isVisible(RectangleF rect)

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

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

isVisible

public boolean isVisible(RectangleF rect,
                         Graphics g)

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

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

isVisible

public boolean isVisible(Rectangle rect,
                         Graphics g)

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

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

makeEmpty

public void makeEmpty()

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


makeInfinite

public void makeInfinite()

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


transform

public void transform(Matrix matrix)

Transforms this com.aspose.imaging.Region by the specified com.aspose.imaging.Matrix.


translate

public void translate(float dx,
                      float dy)

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

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

translate

public void translate(int dx,
                      int dy)

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

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

union

public void union(GraphicsPath path)

Updates this com.aspose.imaging.Region to the union of itself and the specified com.aspose.imaging.GraphicsPath.


union

public void union(Rectangle rect)

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

Parameters:
rect - The com.aspose.imaging.Rectangle structure to unite with this com.aspose.imaging.Region.

union

public void union(RectangleF rect)

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

Parameters:
rect - The com.aspose.imaging.RectangleF structure to unite with this com.aspose.imaging.Region.

union

public void union(Region region)

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

.


xor

public void xor(GraphicsPath path)

Updates this com.aspose.imaging.Region to the union minus the intersection of itself with the specified com.aspose.imaging.GraphicsPath.


xor

public void xor(Rectangle rect)

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

Parameters:
rect - The com.aspose.imaging.Rectangle structure to xor with this com.aspose.imaging.Region.

xor

public void xor(RectangleF rect)

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

Parameters:
rect - The com.aspose.imaging.RectangleF structure to xor with this com.aspose.imaging.Region.

xor

public void xor(Region region)

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