Region

Inheritance: java.lang.Object

All Implemented Interfaces: com.aspose.ms.System.IDisposable

public final class Region implements System.IDisposable

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

Constructors

ConstructorDescription
Region()Initializes a new instance of the Region class.
Region(RectangleF rect)Initializes a new instance of the Region class from the specified RectangleF structure.
Region(Rectangle rect)Initializes a new instance of the Region class from the specified Rectangle structure.
Region(GraphicsPath path)Initializes a new instance of the Region class with the specified GraphicsPath.
Region(RegionData rgnData)Initializes a new instance of the Region class from the specified data.

Methods

MethodDescription
dispose()Releases all resources used by this Region.
equals(Region region, Graphics g)Tests whether the specified Region is identical to this Region on the specified drawing surface.
deepClone()Creates an exact copy of this Region.
makeInfinite()Initializes this Region object to an infinite interior.
makeEmpty()Initializes this Region to an empty interior.
intersect(RectangleF rect)Updates this Region to the intersection of itself with the specified RectangleF structure.
intersect(Rectangle rect)Updates this Region to the intersection of itself with the specified Rectangle structure.
intersect(GraphicsPath path)Updates this Region to the intersection of itself with the specified GraphicsPath.
intersect(Region region)Updates this Region to the intersection of itself with the specified Region.
union(RectangleF rect)Updates this Region to the union of itself and the specified RectangleF structure.
union(Rectangle rect)Updates this Region to the union of itself and the specified Rectangle structure.
union(GraphicsPath path)Updates this Region to the union of itself and the specified GraphicsPath.
union(Region region)Updates this Region to the union of itself and the specified Region.
getRegionData()Returns a RegionData that represents the information that describes this Region.
xor(RectangleF rect)Updates this Region to the union minus the intersection of itself with the specified RectangleF structure.
xor(Rectangle rect)Updates this Region to the union minus the intersection of itself with the specified Rectangle structure.
xor(GraphicsPath path)Updates this Region to the union minus the intersection of itself with the specified GraphicsPath.
xor(Region region)Updates this Region to the union minus the intersection of itself with the specified Region.
exclude(RectangleF rect)Updates this Region to contain only the portion of its interior that does not intersect with the specified RectangleF structure.
exclude(Rectangle rect)Updates this Region to contain only the portion of its interior that does not intersect with the specified Rectangle structure.
exclude(GraphicsPath path)Updates this Region to contain only the portion of its interior that does not intersect with the specified GraphicsPath.
exclude(Region region)Updates this Region to contain only the portion of its interior that does not intersect with the specified Region.
complement(RectangleF rect)Updates this Region to contain the portion of the specified RectangleF structure that does not intersect with this Region.
complement(Rectangle rect)Updates this Region to contain the portion of the specified Rectangle structure that does not intersect with this Region.
complement(GraphicsPath path)Updates this Region to contain the portion of the specified GraphicsPath that does not intersect with this Region.
complement(Region region)Updates this Region to contain the portion of the specified Region that does not intersect with this Region.
translate(float dx, float dy)Offsets the coordinates of this Region by the specified amount.
translate(int dx, int dy)Offsets the coordinates of this Region by the specified amount.
transform(Matrix matrix)Transforms this Region by the specified Matrix.
getBounds(Graphics g)Gets a RectangleF structure that represents a rectangle that bounds this Region on the drawing surface of a Graphics object.
getRegionScans(Matrix matrix)Returns an array of RectangleF structures that approximate this Region after the specified matrix transformation is applied.
isEmpty(Graphics g)Tests whether this Region has an empty interior on the specified drawing surface.
isInfinite(Graphics g)Tests whether this Region has an infinite interior on the specified drawing surface.
isVisible(float x, float y)Tests whether the specified point is contained within this Region.
isVisible(PointF point)Tests whether the specified PointF structure is contained within this Region.
isVisible(float x, float y, Graphics g)Tests whether the specified point is contained within this Region when drawn using the specified Graphics.
isVisible(PointF point, Graphics g)Tests whether the specified PointF structure is contained within this Region when drawn using the specified Graphics.
isVisible(float x, float y, float width, float height)Tests whether any portion of the specified rectangle is contained within this Region.
isVisible(RectangleF rect)Tests whether any portion of the specified RectangleF structure is contained within this Region.
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.
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.
isVisible(int x, int y, Graphics g)Tests whether the specified point is contained within this Region object when drawn using the specified Graphics object.
isVisible(Point point)Tests whether the specified Point structure is contained within this Region.
isVisible(Point point, Graphics g)Tests whether the specified Point structure is contained within this Region when drawn using the specified Graphics.
isVisible(int x, int y, int width, int height)Tests whether any portion of the specified rectangle is contained within this Region.
isVisible(Rectangle rect)Tests whether any portion of the specified Rectangle structure is contained within this Region.
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.
isVisible(Rectangle rect, Graphics g)Tests whether any portion of the specified Rectangle structure is contained within this Region when drawn using the specified Graphics.

Region()

public Region()

Initializes a new instance of the Region class.

Region(RectangleF rect)

public Region(RectangleF rect)

Initializes a new instance of the Region class from the specified RectangleF structure.

Parameters:

ParameterTypeDescription
rectRectangleFA RectangleF structure that defines the interior of the new Region.

Region(Rectangle rect)

public Region(Rectangle rect)

Initializes a new instance of the Region class from the specified Rectangle structure.

Parameters:

ParameterTypeDescription
rectRectangleA Rectangle structure that defines the interior of the new Region.

Region(GraphicsPath path)

public Region(GraphicsPath path)

Initializes a new instance of the Region class with the specified GraphicsPath.

Parameters:

ParameterTypeDescription
pathGraphicsPathA GraphicsPath that defines the new Region.

Region(RegionData rgnData)

public Region(RegionData rgnData)

Initializes a new instance of the Region class from the specified data.

Parameters:

ParameterTypeDescription
rgnDataRegionDataA RegionData that defines the interior of the new Region.

dispose()

public void dispose()

Releases all resources used by this Region.

equals(Region region, Graphics g)

public boolean equals(Region region, Graphics g)

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

Parameters:

ParameterTypeDescription
regionRegionThe Region to test.
gGraphicsA Graphics that represents a drawing surface.

Returns: boolean - 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.

deepClone()

public Region deepClone()

Creates an exact copy of this Region.

Returns: Region - The Region that this method creates.

makeInfinite()

public void makeInfinite()

Initializes this Region object to an infinite interior.

makeEmpty()

public void makeEmpty()

Initializes this Region to an empty interior.

intersect(RectangleF rect)

public void intersect(RectangleF rect)

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

Parameters:

ParameterTypeDescription
rectRectangleFThe RectangleF structure to intersect with this Region.

intersect(Rectangle rect)

public void intersect(Rectangle rect)

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

Parameters:

ParameterTypeDescription
rectRectangleThe Rectangle structure to intersect with this Region.

intersect(GraphicsPath path)

public void intersect(GraphicsPath path)

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

Parameters:

ParameterTypeDescription
pathGraphicsPathThe GraphicsPath to intersect with this Region.

intersect(Region region)

public void intersect(Region region)

Updates this Region to the intersection of itself with the specified Region.

Parameters:

ParameterTypeDescription
regionRegionThe Region to intersect with this Region.

union(RectangleF rect)

public void union(RectangleF rect)

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

Parameters:

ParameterTypeDescription
rectRectangleFThe RectangleF structure to unite with this Region.

Union leaves infinite region as infinite. |

union(Rectangle rect)

public void union(Rectangle rect)

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

Parameters:

ParameterTypeDescription
rectRectangleThe Rectangle structure to unite with this Region.

Union leaves infinite region as infinite. |

union(GraphicsPath path)

public void union(GraphicsPath path)

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

Parameters:

ParameterTypeDescription
pathGraphicsPathThe GraphicsPath to unite with this Region.

Union leaves infinite region as infinite. |

union(Region region)

public void union(Region region)

Updates this Region to the union of itself and the specified Region.

Parameters:

ParameterTypeDescription
regionRegionThe Region to unite with this Region.

Union leaves infinite region as infinite. |

getRegionData()

public RegionData getRegionData()

Returns a RegionData that represents the information that describes this Region.

Returns: RegionData - A RegionData that represents the information that describes this Region.

xor(RectangleF rect)

public void xor(RectangleF rect)

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

Parameters:

ParameterTypeDescription
rectRectangleFThe RectangleF structure to M:Region.Xor(Drawing2D.GraphicsPath) with this Region.

xor(Rectangle rect)

public void xor(Rectangle rect)

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

Parameters:

ParameterTypeDescription
rectRectangleThe Rectangle structure to M:Region.Xor(Rectangle) with this Region.

xor(GraphicsPath path)

public void xor(GraphicsPath path)

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

Parameters:

ParameterTypeDescription
pathGraphicsPathThe GraphicsPath to M:Region.Xor(GraphicsPath) with this Region.

xor(Region region)

public void xor(Region region)

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

Parameters:

ParameterTypeDescription
regionRegionThe Region to M:Region.Xor(Region) with this Region.

exclude(RectangleF rect)

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.

Parameters:

ParameterTypeDescription
rectRectangleFThe RectangleF structure to exclude from this Region.

exclude(Rectangle rect)

public void exclude(Rectangle rect)

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

Parameters:

ParameterTypeDescription
rectRectangleThe Rectangle structure to exclude from this Region.

exclude(GraphicsPath path)

public void exclude(GraphicsPath path)

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

Parameters:

ParameterTypeDescription
pathGraphicsPathThe GraphicsPath to exclude from this Region.

exclude(Region region)

public void exclude(Region region)

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

Parameters:

ParameterTypeDescription
regionRegionThe Region to exclude from this Region.

complement(RectangleF rect)

public void complement(RectangleF rect)

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

Parameters:

ParameterTypeDescription
rectRectangleFThe RectangleF structure to complement this Region.

complement(Rectangle rect)

public void complement(Rectangle rect)

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

Parameters:

ParameterTypeDescription
rectRectangleThe Rectangle structure to complement this Region.

complement(GraphicsPath path)

public void complement(GraphicsPath path)

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

Parameters:

ParameterTypeDescription
pathGraphicsPathThe GraphicsPath to complement this Region.

complement(Region region)

public void complement(Region region)

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

Parameters:

ParameterTypeDescription
regionRegionThe Region object to complement this Region object.

translate(float dx, float dy)

public void translate(float dx, float dy)

Offsets the coordinates of this Region by the specified amount.

Parameters:

ParameterTypeDescription
dxfloatThe amount to offset this Region horizontally.
dyfloatThe amount to offset this Region vertically.

translate(int dx, int dy)

public void translate(int dx, int dy)

Offsets the coordinates of this Region by the specified amount.

Parameters:

ParameterTypeDescription
dxintThe amount to offset this Region horizontally
dyintThe amount to offset this Region vertically.

transform(Matrix matrix)

public void transform(Matrix matrix)

Transforms this Region by the specified Matrix.

Parameters:

ParameterTypeDescription
matrixMatrixThe Matrix by which to transform this Region.

getBounds(Graphics g)

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.

Parameters:

ParameterTypeDescription
gGraphicsThe Graphics on which this Region is drawn.

Returns: RectangleF - A RectangleF structure that represents the bounding rectangle for this Region on the specified drawing surface.

getRegionScans(Matrix matrix)

public RectangleF[] getRegionScans(Matrix matrix)

Returns an array of RectangleF structures that approximate this Region after the specified matrix transformation is applied.

Parameters:

ParameterTypeDescription
matrixMatrixA Matrix that represents a geometric transformation to apply to the region.

Returns: com.aspose.drawing.RectangleF[] - An array of RectangleF structures that approximate this Region after the specified matrix transformation is applied.

isEmpty(Graphics g)

public boolean isEmpty(Graphics g)

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

Parameters:

ParameterTypeDescription
gGraphicsA Graphics that represents a drawing surface.

Returns: boolean - true if the interior of this Region is empty when the transformation associated with g is applied; otherwise, false.

isInfinite(Graphics g)

public boolean isInfinite(Graphics g)

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

Parameters:

ParameterTypeDescription
gGraphicsA Graphics that represents a drawing surface.

Returns: boolean - true if the interior of this Region is infinite when the transformation associated with g is applied; otherwise, false.

isVisible(float x, float y)

public boolean isVisible(float x, float y)

Tests whether the specified point is contained within this Region.

Parameters:

ParameterTypeDescription
xfloatThe x-coordinate of the point to test.
yfloatThe y-coordinate of the point to test.

Returns: boolean - true when the specified point is contained within this Region; otherwise, false.

isVisible(PointF point)

public boolean isVisible(PointF point)

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

Parameters:

ParameterTypeDescription
pointPointFThe PointF structure to test.

Returns: boolean - true when point is contained within this Region; otherwise, false.

isVisible(float x, float y, Graphics g)

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

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

Parameters:

ParameterTypeDescription
xfloatThe x-coordinate of the point to test.
yfloatThe y-coordinate of the point to test.
gGraphicsA Graphics that represents a graphics context.

Returns: boolean - true when the specified point is contained within this Region; otherwise, false.

isVisible(PointF point, Graphics g)

public boolean isVisible(PointF point, Graphics g)

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

Parameters:

ParameterTypeDescription
pointPointFThe PointF structure to test.
gGraphicsA Graphics that represents a graphics context.

Returns: boolean - true when point is contained within this Region; otherwise, false.

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

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

Tests whether any portion of the specified rectangle is contained within this Region.

Parameters:

ParameterTypeDescription
xfloatThe x-coordinate of the upper-left corner of the rectangle to test.
yfloatThe y-coordinate of the upper-left corner of the rectangle to test.
widthfloatThe width of the rectangle to test.
heightfloatThe height of the rectangle to test.

Returns: boolean - true when any portion of the specified rectangle is contained within this Region object; otherwise, false.

isVisible(RectangleF rect)

public boolean isVisible(RectangleF rect)

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

Parameters:

ParameterTypeDescription
rectRectangleFThe RectangleF structure to test.

Returns: boolean - true when any portion of rect is contained within this Region; otherwise, false.

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

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.

Parameters:

ParameterTypeDescription
xfloatThe x-coordinate of the upper-left corner of the rectangle to test.
yfloatThe y-coordinate of the upper-left corner of the rectangle to test.
widthfloatThe width of the rectangle to test.
heightfloatThe height of the rectangle to test.
gGraphicsA Graphics that represents a graphics context.

Returns: boolean - true when any portion of the specified rectangle is contained within this Region; otherwise, false.

isVisible(RectangleF rect, Graphics g)

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.

Parameters:

ParameterTypeDescription
rectRectangleFThe RectangleF structure to test.
gGraphicsA Graphics that represents a graphics context.

Returns: boolean - true when rect is contained within this Region; otherwise, false.

isVisible(int x, int y, Graphics g)

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

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

Parameters:

ParameterTypeDescription
xintThe x-coordinate of the point to test.
yintThe y-coordinate of the point to test.
gGraphicsA Graphics that represents a graphics context.

Returns: boolean - true when the specified point is contained within this Region; otherwise, false.

isVisible(Point point)

public boolean isVisible(Point point)

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

Parameters:

ParameterTypeDescription
pointPointThe Point structure to test.

Returns: boolean - true when point is contained within this Region; otherwise, false.

isVisible(Point point, Graphics g)

public boolean isVisible(Point point, Graphics g)

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

Parameters:

ParameterTypeDescription
pointPointThe Point structure to test.
gGraphicsA Graphics that represents a graphics context.

Returns: boolean - true when point is contained within this Region; otherwise, false.

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

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

Tests whether any portion of the specified rectangle is contained within this Region.

Parameters:

ParameterTypeDescription
xintThe x-coordinate of the upper-left corner of the rectangle to test.
yintThe y-coordinate of the upper-left corner of the rectangle to test.
widthintThe width of the rectangle to test.
heightintThe height of the rectangle to test.

Returns: boolean - true when any portion of the specified rectangle is contained within this Region; otherwise, false.

isVisible(Rectangle rect)

public boolean isVisible(Rectangle rect)

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

Parameters:

ParameterTypeDescription
rectRectangleThe Rectangle structure to test.

Returns: boolean - This method returns true when any portion of rect is contained within this Region; otherwise, false.

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

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.

Parameters:

ParameterTypeDescription
xintThe x-coordinate of the upper-left corner of the rectangle to test.
yintThe y-coordinate of the upper-left corner of the rectangle to test.
widthintThe width of the rectangle to test.
heightintThe height of the rectangle to test.
gGraphicsA Graphics that represents a graphics context.

Returns: boolean - true when any portion of the specified rectangle is contained within this Region; otherwise, false.

isVisible(Rectangle rect, Graphics g)

public boolean isVisible(Rectangle rect, Graphics g)

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

Parameters:

ParameterTypeDescription
rectRectangleThe Rectangle structure to test.
gGraphicsA Graphics that represents a graphics context.

Returns: boolean - true when any portion of the rect is contained within this Region; otherwise, false.