public final class Region extends Object
Describes the interior of a graphics shape composed of rectangles and paths. This class cannot be inherited.
Constructor and Description |
---|
Region()
Initializes a new
Region . |
Region(GraphicsPath path)
Initializes a new
Region with the specified GraphicsPath . |
Region(Rectangle rect)
|
Region(RectangleF rect)
Initializes a new
Region from the specified RectangleF structure. |
Modifier and Type | Method and Description |
---|---|
void |
complement(GraphicsPath path)
Updates this
Region to contain the portion of the specified GraphicsPath that does not intersect with this Region . |
void |
complement(Rectangle rect)
|
void |
complement(RectangleF rect)
Updates this
Region to contain the portion of the specified RectangleF structure that does not intersect with this Region . |
void |
complement(Region region)
|
Region |
deepClone()
Creates an exact deep copy of this
Region . |
boolean |
equals(Region region,
Graphics g)
|
void |
exclude(GraphicsPath path)
Updates this
Region to contain only the portion of its interior that does not intersect with the specified GraphicsPath . |
void |
exclude(Rectangle rect)
|
void |
exclude(RectangleF rect)
Updates this
Region to contain only the portion of its interior that does not intersect with the specified RectangleF structure. |
void |
exclude(Region region)
|
void |
intersect(GraphicsPath path)
Updates this
Region to the intersection of itself with the specified GraphicsPath . |
void |
intersect(Rectangle rect)
|
void |
intersect(RectangleF rect)
Updates this
Region to the intersection of itself with the specified RectangleF structure. |
void |
intersect(Region region)
|
boolean |
isEmpty(Graphics g)
Tests whether this
Region has an empty interior on the specified drawing surface. |
boolean |
isInfinite(Graphics g)
Tests whether this
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
Region . |
boolean |
isVisible(float x,
float y,
float width,
float height)
Tests whether any portion of the specified rectangle is contained within this
Region . |
boolean |
isVisible(float x,
float y,
float width,
float height,
Graphics g)
|
boolean |
isVisible(float x,
float y,
Graphics g)
|
boolean |
isVisible(int x,
int y,
Graphics g)
|
boolean |
isVisible(int x,
int y,
int width,
int height)
Tests whether any portion of the specified rectangle is contained within this
Region . |
boolean |
isVisible(int x,
int y,
int width,
int height,
Graphics g)
|
boolean |
isVisible(Point point)
|
boolean |
isVisible(PointF point)
|
boolean |
isVisible(PointF point,
Graphics g)
|
boolean |
isVisible(Point point,
Graphics g)
|
boolean |
isVisible(Rectangle rect)
|
boolean |
isVisible(RectangleF rect)
Tests whether any portion of the specified
RectangleF structure is contained within this Region . |
boolean |
isVisible(RectangleF rect,
Graphics g)
Tests whether any portion of the specified
RectangleF structure is contained within this Region when drawn using the specified Graphics . |
boolean |
isVisible(Rectangle rect,
Graphics g)
|
void |
makeEmpty()
Initializes this
Region to an empty interior. |
void |
makeInfinite()
Initializes this
Region object to an infinite interior. |
void |
transform(Matrix matrix)
|
void |
translate(float dx,
float dy)
Offsets the coordinates of this
Region by the specified amount. |
void |
translate(int dx,
int dy)
Offsets the coordinates of this
Region by the specified amount. |
void |
union(GraphicsPath path)
Updates this
Region to the union of itself and the specified GraphicsPath . |
void |
union(Rectangle rect)
|
void |
union(RectangleF rect)
Updates this
Region to the union of itself and the specified RectangleF structure. |
void |
union(Region region)
|
void |
xor(GraphicsPath path)
Updates this
Region to the union minus the intersection of itself with the specified GraphicsPath . |
void |
xor(Rectangle rect)
|
void |
xor(RectangleF rect)
Updates this
Region to the union minus the intersection of itself with the specified RectangleF structure. |
void |
xor(Region region)
|
public Region()
Initializes a new Region
.
public Region(RectangleF rect)
Initializes a new Region
from the specified RectangleF
structure.
rect
- A RectangleF
structure that defines the interior of the new Region
.public Region(Rectangle rect)
public Region(GraphicsPath path)
Initializes a new Region
with the specified GraphicsPath
.
path
- A GraphicsPath
that defines the new Region
.com.aspose.ms.System.ArgumentNullException
- path
is null.public final Region deepClone()
Creates an exact deep copy of this Region
.
Region
that this method creates.public final void makeInfinite()
Initializes this Region
object to an infinite interior.
public final void makeEmpty()
Initializes this Region
to an empty interior.
public final void intersect(RectangleF rect)
Updates this Region
to the intersection of itself with the specified RectangleF
structure.
rect
- The RectangleF
structure to intersect with this Region
.public final void intersect(Rectangle rect)
public final void intersect(GraphicsPath path)
Updates this Region
to the intersection of itself with the specified GraphicsPath
.
path
- The GraphicsPath
to intersect with this Region
.public final void intersect(Region region)
public final void union(RectangleF rect)
Updates this Region
to the union of itself and the specified RectangleF
structure.
rect
- The RectangleF
structure to unite with this Region
.public final void union(Rectangle rect)
public final void union(GraphicsPath path)
Updates this Region
to the union of itself and the specified GraphicsPath
.
path
- The GraphicsPath
to unite with this Region
.com.aspose.ms.System.ArgumentNullException
- path
is null.public final void union(Region region)
public final void xor(RectangleF rect)
Updates this Region
to the union minus the intersection of itself with the specified RectangleF
structure.
rect
- The RectangleF
structure to xor with this Region
.public final void xor(Rectangle rect)
public final void xor(GraphicsPath path)
Updates this Region
to the union minus the intersection of itself with the specified GraphicsPath
.
path
- The GraphicsPath
to xor with this Region
.com.aspose.ms.System.ArgumentNullException
- path
is null.public final void xor(Region region)
public final void exclude(RectangleF rect)
Updates this Region
to contain only the portion of its interior that does not intersect with the specified RectangleF
structure.
rect
- The RectangleF
structure to exclude from this Region
.public final void exclude(Rectangle rect)
public final void exclude(GraphicsPath path)
Updates this Region
to contain only the portion of its interior that does not intersect with the specified GraphicsPath
.
path
- The GraphicsPath
to exclude from this Region
.com.aspose.ms.System.ArgumentNullException
- path
is null.public final void exclude(Region region)
public final void complement(RectangleF rect)
Updates this Region
to contain the portion of the specified RectangleF
structure that does not intersect with this Region
.
rect
- The RectangleF
structure to complement this Region
.public final void complement(Rectangle rect)
public final void complement(GraphicsPath path)
Updates this Region
to contain the portion of the specified GraphicsPath
that does not intersect with this Region
.
path
- The GraphicsPath
to complement this Region
.com.aspose.ms.System.ArgumentNullException
- path
isnull.public final void complement(Region region)
public final void translate(float dx, float dy)
Offsets the coordinates of this Region
by the specified amount.
public final void translate(int dx, int dy)
Offsets the coordinates of this Region
by the specified amount.
public final void transform(Matrix matrix)
public final boolean isEmpty(Graphics g)
Tests whether this Region
has an empty interior on the specified drawing surface.
public final boolean isInfinite(Graphics g)
Tests whether this Region
has an infinite interior on the specified drawing surface.
public final boolean equals(Region region, Graphics g)
region
- The Region
to test.g
- A Graphics
that represents a drawing surface.g
parameter is applied; otherwise, false.com.aspose.ms.System.ArgumentNullException
- g
orregion
is null.public final boolean isVisible(float x, float y)
Tests whether the specified point is contained within this Region
.
x
- The x-coordinate of the point to test.y
- The y-coordinate of the point to test.Region
; otherwise, false.public final boolean isVisible(PointF point)
public final boolean isVisible(float x, float y, Graphics g)
public final boolean isVisible(float x, float y, float width, float height)
Tests whether any portion of the specified rectangle is contained within this Region
.
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.Region
object; otherwise, false.public final boolean isVisible(RectangleF rect)
Tests whether any portion of the specified RectangleF
structure is contained within this Region
.
rect
- The RectangleF
structure to test.rect
is contained within this Region
; otherwise, false.public final boolean isVisible(float x, float y, float width, float height, Graphics g)
Tests whether any portion of the specified rectangle is contained within this Region
when drawn using the specified Graphics
.
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 Graphics
that represents a graphics context.Region
; otherwise, false.public final boolean isVisible(RectangleF rect, Graphics g)
Tests whether any portion of the specified RectangleF
structure is contained within this Region
when drawn using the specified Graphics
.
rect
- The RectangleF
structure to test.g
- A Graphics
that represents a graphics context.rect
is contained within this Region
; otherwise, false.public final boolean isVisible(int x, int y, Graphics g)
public final boolean isVisible(Point point)
public final boolean isVisible(int x, int y, int width, int height)
Tests whether any portion of the specified rectangle is contained within this Region
.
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.Region
; otherwise, false.public final boolean isVisible(Rectangle rect)
public final boolean isVisible(int x, int y, int width, int height, Graphics g)
Tests whether any portion of the specified rectangle is contained within this Region
when drawn using the specified Graphics
.
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 Graphics
that represents a graphics context.Region
; otherwise, false.Copyright (c) 2008-2020 Aspose Pty Ltd. All Rights Reserved.