public final class Region extends Object implements com.aspose.ms.System.IDisposable
Describes the interior of a graphics shape composed of rectangles and paths. This class cannot be inherited.
| Constructor and Description |
|---|
Region()
Initializes a new instance of the
Region class. |
Region(GraphicsPath path)
Initializes a new instance of the
Region class with the specified GraphicsPath. |
Region(Rectangle rect)
|
Region(RectangleF rect)
Initializes a new instance of the
Region class from the specified RectangleF structure. |
Region(RegionData rgnData)
Initializes a new instance of the
Region class from the specified data. |
| 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 copy of this
Region. |
void |
dispose()
Releases all resources used by 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)
|
RectangleF |
getBounds(Graphics g)
Gets a
RectangleF structure that represents a rectangle that bounds this Region
on the drawing surface of a Graphics object. |
RegionData |
getRegionData()
Returns a
RegionData that represents the information that describes this Region. |
RectangleF[] |
getRegionScans(Matrix matrix)
Returns an array of
RectangleF structures that approximate this Region
after the specified matrix transformation is applied. |
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 instance of the Region class.
public Region(RectangleF rect)
Initializes a new instance of the Region class 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 instance of the Region class with the specified GraphicsPath.
path - A GraphicsPath that defines the new Region.public Region(RegionData rgnData)
Initializes a new instance of the Region class from the specified data.
rgnData - A RegionData that defines the interior of the new Region.public void dispose()
Releases all resources used by this Region.
dispose in interface com.aspose.ms.System.IDisposablepublic Region deepClone()
Creates an exact copy of this Region.
Region that this method creates.public void makeInfinite()
Initializes this Region object to an infinite interior.
public void makeEmpty()
Initializes this Region to an empty interior.
public 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 void intersect(Rectangle rect)
public 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 void intersect(Region region)
public 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 void union(Rectangle rect)
public void union(GraphicsPath path)
Updates this Region to the union of itself and the specified GraphicsPath.
path - The GraphicsPath to unite with this Region.
public void union(Region region)
public RegionData getRegionData()
Returns a RegionData that represents the information that describes this Region.
RegionData that represents the information that describes this Region.public 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 M:Region.Xor(drawing2d.GraphicsPath) with this Region.public void xor(Rectangle rect)
public void xor(GraphicsPath path)
Updates this Region to the union minus the intersection of itself with the
specified GraphicsPath.
path - The GraphicsPath to M:Region.Xor(GraphicsPath) with
this Region.public void xor(Region region)
public 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 void exclude(Rectangle rect)
public 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.public void exclude(Region region)
public 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 void complement(Rectangle rect)
public 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.public void complement(Region region)
public void translate(float dx,
float dy)
Offsets the coordinates of this Region by the specified amount.
public void translate(int dx,
int dy)
Offsets the coordinates of this Region by the specified amount.
public void transform(Matrix matrix)
public RectangleF getBounds(Graphics g)
Gets a RectangleF structure that represents a rectangle that bounds this Region
on the drawing surface of a Graphics object.
g - The Graphics on which this Region is drawn.RectangleF structure that represents the bounding rectangle for this
Region on the specified drawing surface.public RectangleF[] getRegionScans(Matrix matrix)
Returns an array of RectangleF structures that approximate this Region
after the specified matrix transformation is applied.
matrix - A Matrix that represents a geometric transformation to apply to the region.RectangleF structures that approximate this Region
after the specified matrix transformation is applied.public boolean isEmpty(Graphics g)
Tests whether this Region has an empty interior on the specified drawing surface.
public boolean isInfinite(Graphics g)
Tests whether this Region has an infinite interior on the specified drawing surface.
public 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 boolean isVisible(PointF point)
public boolean isVisible(float x,
float y,
Graphics g)
public 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 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 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 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 boolean isVisible(int x,
int y,
Graphics g)
public boolean isVisible(Point point)
public 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 boolean isVisible(Rectangle rect)
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 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-2025 Aspose Pty Ltd. All Rights Reserved.