• DR-IT Software
  • Products
  • Documentation
  • Product page
  • Examples
  • API reference
  • Support
Show / Hide Table of Contents

Class Region

Describes the interior of a graphics shape composed of rectangles, paths, and set operations (union, intersection, exclusion, complement, xor).

Inheritance
object
Region
Implements
IDisposable
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: DRIT.Drawing.Drawing2D
Assembly: DRIT.Drawing.dll
Syntax
public sealed class Region : IDisposable
Remarks

A Region can be used to clip drawing operations to a specific area. Regions support boolean operations like Union, Intersect, Exclude, Complement, and Xor.

Constructors

Region()

Creates an infinite region.

Declaration
public Region()
Remarks

A Region can be used to clip drawing operations to a specific area. Regions support boolean operations like Union, Intersect, Exclude, Complement, and Xor.

Region(GraphicsPath)

Creates a region that has the same interior as a path.

Declaration
public Region(GraphicsPath path)
Parameters
Type Name Description
GraphicsPath path
Remarks

A Region can be used to clip drawing operations to a specific area. Regions support boolean operations like Union, Intersect, Exclude, Complement, and Xor.

Region(RegionData)

Initialises a Region from serialized data.

Declaration
public Region(RegionData rgnData)
Parameters
Type Name Description
RegionData rgnData
Remarks

A Region can be used to clip drawing operations to a specific area. Regions support boolean operations like Union, Intersect, Exclude, Complement, and Xor.

Region(Rectangle)

Creates a region from a rectangle.

Declaration
public Region(Rectangle rect)
Parameters
Type Name Description
Rectangle rect
Remarks

A Region can be used to clip drawing operations to a specific area. Regions support boolean operations like Union, Intersect, Exclude, Complement, and Xor.

Region(RectangleF)

Creates a region from a rectangle.

Declaration
public Region(RectangleF rect)
Parameters
Type Name Description
RectangleF rect
Remarks

A Region can be used to clip drawing operations to a specific area. Regions support boolean operations like Union, Intersect, Exclude, Complement, and Xor.

Methods

Clone()

Creates an exact copy of this Region.

Declaration
public Region Clone()
Returns
Type Description
Region

A new Region that is a copy of this instance.

Remarks

A Region can be used to clip drawing operations to a specific area. Regions support boolean operations like Union, Intersect, Exclude, Complement, and Xor.

Complement(GraphicsPath)

Updates this region to the complement of itself relative to the specified path.

Declaration
public void Complement(GraphicsPath path)
Parameters
Type Name Description
GraphicsPath path

The path to use for the complement operation.

Remarks

A Region can be used to clip drawing operations to a specific area. Regions support boolean operations like Union, Intersect, Exclude, Complement, and Xor.

Complement(Region)

Updates this region to the complement of itself relative to the specified region.

Declaration
public void Complement(Region region)
Parameters
Type Name Description
Region region

The region to use for the complement operation.

Remarks

A Region can be used to clip drawing operations to a specific area. Regions support boolean operations like Union, Intersect, Exclude, Complement, and Xor.

Complement(Rectangle)

Updates this region to the complement of itself relative to the specified rectangle.

Declaration
public void Complement(Rectangle rect)
Parameters
Type Name Description
Rectangle rect

The rectangle to use for the complement operation.

Remarks

A Region can be used to clip drawing operations to a specific area. Regions support boolean operations like Union, Intersect, Exclude, Complement, and Xor.

Complement(RectangleF)

Updates this region to the complement of itself relative to the specified rectangle.

Declaration
public void Complement(RectangleF rect)
Parameters
Type Name Description
RectangleF rect

The rectangle to use for the complement operation.

Remarks

A Region can be used to clip drawing operations to a specific area. Regions support boolean operations like Union, Intersect, Exclude, Complement, and Xor.

Dispose()

Releases all resources used by this Region.

Declaration
public void Dispose()
Remarks

A Region can be used to clip drawing operations to a specific area. Regions support boolean operations like Union, Intersect, Exclude, Complement, and Xor.

Equals(Region, Graphics?)

Tests whether this region has the same interior as region. Uses point-sampling since full rasterization requires Graphics (Batch 7).

Declaration
public bool Equals(Region region, Graphics? g = null)
Parameters
Type Name Description
Region region
Graphics g
Returns
Type Description
bool
Remarks

A Region can be used to clip drawing operations to a specific area. Regions support boolean operations like Union, Intersect, Exclude, Complement, and Xor.

Exclude(GraphicsPath)

Updates this region to the exclusion of the specified path.

Declaration
public void Exclude(GraphicsPath path)
Parameters
Type Name Description
GraphicsPath path

The path to exclude.

Remarks

A Region can be used to clip drawing operations to a specific area. Regions support boolean operations like Union, Intersect, Exclude, Complement, and Xor.

Exclude(Region)

Updates this region to the exclusion of the specified region.

Declaration
public void Exclude(Region region)
Parameters
Type Name Description
Region region

The region to exclude.

Remarks

A Region can be used to clip drawing operations to a specific area. Regions support boolean operations like Union, Intersect, Exclude, Complement, and Xor.

Exclude(Rectangle)

Updates this region to the exclusion of the specified rectangle.

Declaration
public void Exclude(Rectangle rect)
Parameters
Type Name Description
Rectangle rect

The rectangle to exclude.

Remarks

A Region can be used to clip drawing operations to a specific area. Regions support boolean operations like Union, Intersect, Exclude, Complement, and Xor.

Exclude(RectangleF)

Updates this region to the exclusion of the specified rectangle.

Declaration
public void Exclude(RectangleF rect)
Parameters
Type Name Description
RectangleF rect

The rectangle to exclude.

Remarks

A Region can be used to clip drawing operations to a specific area. Regions support boolean operations like Union, Intersect, Exclude, Complement, and Xor.

GetBounds(Graphics?)

Gets the bounding rectangle of this region.

Declaration
public RectangleF GetBounds(Graphics? g = null)
Parameters
Type Name Description
Graphics g
Returns
Type Description
RectangleF
Remarks

A Region can be used to clip drawing operations to a specific area. Regions support boolean operations like Union, Intersect, Exclude, Complement, and Xor.

GetRegionData()

Returns a RegionData object that represents the information stored in this Region.

Declaration
public RegionData GetRegionData()
Returns
Type Description
RegionData
Remarks

A Region can be used to clip drawing operations to a specific area. Regions support boolean operations like Union, Intersect, Exclude, Complement, and Xor.

GetRegionScans(Matrix)

Returns an array of RectangleF that approximate the region as a set of horizontal scan bands. The returned rectangles are transformed by matrix (pass new Matrix() for identity).

Declaration
public RectangleF[] GetRegionScans(Matrix matrix)
Parameters
Type Name Description
Matrix matrix
Returns
Type Description
RectangleF[]
Remarks

A Region can be used to clip drawing operations to a specific area. Regions support boolean operations like Union, Intersect, Exclude, Complement, and Xor.

Intersect(GraphicsPath)

Updates this region to the intersection of itself and the specified path.

Declaration
public void Intersect(GraphicsPath path)
Parameters
Type Name Description
GraphicsPath path

The path to intersect with.

Remarks

A Region can be used to clip drawing operations to a specific area. Regions support boolean operations like Union, Intersect, Exclude, Complement, and Xor.

Intersect(Region)

Updates this region to the intersection of itself and the specified region.

Declaration
public void Intersect(Region region)
Parameters
Type Name Description
Region region

The region to intersect with.

Remarks

A Region can be used to clip drawing operations to a specific area. Regions support boolean operations like Union, Intersect, Exclude, Complement, and Xor.

Intersect(Rectangle)

Updates this region to the intersection of itself and the specified rectangle.

Declaration
public void Intersect(Rectangle rect)
Parameters
Type Name Description
Rectangle rect

The rectangle to intersect with.

Remarks

A Region can be used to clip drawing operations to a specific area. Regions support boolean operations like Union, Intersect, Exclude, Complement, and Xor.

Intersect(RectangleF)

Updates this region to the intersection of itself and the specified rectangle.

Declaration
public void Intersect(RectangleF rect)
Parameters
Type Name Description
RectangleF rect

The rectangle to intersect with.

Remarks

A Region can be used to clip drawing operations to a specific area. Regions support boolean operations like Union, Intersect, Exclude, Complement, and Xor.

IsEmpty(Graphics?)

Gets a value indicating whether this region is empty.

Declaration
public bool IsEmpty(Graphics? g = null)
Parameters
Type Name Description
Graphics g

The graphics context (optional).

Returns
Type Description
bool

true if the region is empty; otherwise, false.

Remarks

A Region can be used to clip drawing operations to a specific area. Regions support boolean operations like Union, Intersect, Exclude, Complement, and Xor.

IsInfinite(Graphics?)

Gets a value indicating whether this region is infinite.

Declaration
public bool IsInfinite(Graphics? g = null)
Parameters
Type Name Description
Graphics g

The graphics context (optional).

Returns
Type Description
bool

true if the region is infinite; otherwise, false.

Remarks

A Region can be used to clip drawing operations to a specific area. Regions support boolean operations like Union, Intersect, Exclude, Complement, and Xor.

IsVisible(Point)

Determines whether the specified point is visible within this region.

Declaration
public bool IsVisible(Point pt)
Parameters
Type Name Description
Point pt

The point to test.

Returns
Type Description
bool

true if the point is visible; otherwise, false.

Remarks

A Region can be used to clip drawing operations to a specific area. Regions support boolean operations like Union, Intersect, Exclude, Complement, and Xor.

IsVisible(Point, Graphics?)

Determines whether the specified point is visible within this region.

Declaration
public bool IsVisible(Point pt, Graphics? g)
Parameters
Type Name Description
Point pt

The point to test.

Graphics g

The graphics context (optional).

Returns
Type Description
bool

true if the point is visible; otherwise, false.

Remarks

A Region can be used to clip drawing operations to a specific area. Regions support boolean operations like Union, Intersect, Exclude, Complement, and Xor.

IsVisible(PointF)

Determines whether the specified point is visible within this region.

Declaration
public bool IsVisible(PointF pt)
Parameters
Type Name Description
PointF pt

The point to test.

Returns
Type Description
bool

true if the point is visible; otherwise, false.

Remarks

A Region can be used to clip drawing operations to a specific area. Regions support boolean operations like Union, Intersect, Exclude, Complement, and Xor.

IsVisible(PointF, Graphics?)

Determines whether the specified point is visible within this region.

Declaration
public bool IsVisible(PointF pt, Graphics? g)
Parameters
Type Name Description
PointF pt

The point to test.

Graphics g

The graphics context (optional).

Returns
Type Description
bool

true if the point is visible; otherwise, false.

Remarks

A Region can be used to clip drawing operations to a specific area. Regions support boolean operations like Union, Intersect, Exclude, Complement, and Xor.

IsVisible(Rectangle, Graphics?)

Returns true if any part of rect lies within this region.

Declaration
public bool IsVisible(Rectangle rect, Graphics? g = null)
Parameters
Type Name Description
Rectangle rect

The rectangle to test.

Graphics g

The graphics context (optional).

Returns
Type Description
bool

true if any part of the rectangle is visible; otherwise, false.

Remarks

A Region can be used to clip drawing operations to a specific area. Regions support boolean operations like Union, Intersect, Exclude, Complement, and Xor.

IsVisible(RectangleF, Graphics?)

Returns true if any part of rect lies within this region.

Declaration
public bool IsVisible(RectangleF rect, Graphics? g = null)
Parameters
Type Name Description
RectangleF rect
Graphics g
Returns
Type Description
bool
Remarks

A Region can be used to clip drawing operations to a specific area. Regions support boolean operations like Union, Intersect, Exclude, Complement, and Xor.

IsVisible(int, int, Graphics?)

Determines whether the specified point is visible within this region.

Declaration
public bool IsVisible(int x, int y, Graphics? g)
Parameters
Type Name Description
int x

The X coordinate of the point.

int y

The Y coordinate of the point.

Graphics g

The graphics context (optional).

Returns
Type Description
bool

true if the point is visible; otherwise, false.

Remarks

A Region can be used to clip drawing operations to a specific area. Regions support boolean operations like Union, Intersect, Exclude, Complement, and Xor.

IsVisible(float, float)

Determines whether the specified point is visible within this region.

Declaration
public bool IsVisible(float x, float y)
Parameters
Type Name Description
float x

The X coordinate of the point.

float y

The Y coordinate of the point.

Returns
Type Description
bool

true if the point is visible; otherwise, false.

Remarks

A Region can be used to clip drawing operations to a specific area. Regions support boolean operations like Union, Intersect, Exclude, Complement, and Xor.

IsVisible(float, float, Graphics?)

Determines whether the specified point is visible within this region.

Declaration
public bool IsVisible(float x, float y, Graphics? g)
Parameters
Type Name Description
float x

The X coordinate of the point.

float y

The Y coordinate of the point.

Graphics g

The graphics context (optional).

Returns
Type Description
bool

true if the point is visible; otherwise, false.

Remarks

A Region can be used to clip drawing operations to a specific area. Regions support boolean operations like Union, Intersect, Exclude, Complement, and Xor.

MakeEmpty()

Makes this region empty (contains no points).

Declaration
public void MakeEmpty()
Remarks

A Region can be used to clip drawing operations to a specific area. Regions support boolean operations like Union, Intersect, Exclude, Complement, and Xor.

MakeInfinite()

Makes this region infinite (contains all points).

Declaration
public void MakeInfinite()
Remarks

A Region can be used to clip drawing operations to a specific area. Regions support boolean operations like Union, Intersect, Exclude, Complement, and Xor.

Transform(Matrix)

Transforms this region by the specified matrix.

Declaration
public void Transform(Matrix matrix)
Parameters
Type Name Description
Matrix matrix

The transformation matrix.

Remarks

A Region can be used to clip drawing operations to a specific area. Regions support boolean operations like Union, Intersect, Exclude, Complement, and Xor.

Translate(int, int)

Translates this region by the specified offsets.

Declaration
public void Translate(int dx, int dy)
Parameters
Type Name Description
int dx

The horizontal translation.

int dy

The vertical translation.

Remarks

A Region can be used to clip drawing operations to a specific area. Regions support boolean operations like Union, Intersect, Exclude, Complement, and Xor.

Translate(float, float)

Translates this region by the specified offsets.

Declaration
public void Translate(float dx, float dy)
Parameters
Type Name Description
float dx

The horizontal translation.

float dy

The vertical translation.

Remarks

A Region can be used to clip drawing operations to a specific area. Regions support boolean operations like Union, Intersect, Exclude, Complement, and Xor.

Union(GraphicsPath)

Updates this region to the union of itself and the specified path.

Declaration
public void Union(GraphicsPath path)
Parameters
Type Name Description
GraphicsPath path

The path to union with.

Remarks

A Region can be used to clip drawing operations to a specific area. Regions support boolean operations like Union, Intersect, Exclude, Complement, and Xor.

Union(Region)

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

Declaration
public void Union(Region region)
Parameters
Type Name Description
Region region

The region to union with.

Remarks

A Region can be used to clip drawing operations to a specific area. Regions support boolean operations like Union, Intersect, Exclude, Complement, and Xor.

Union(Rectangle)

Updates this region to the union of itself and the specified rectangle.

Declaration
public void Union(Rectangle rect)
Parameters
Type Name Description
Rectangle rect

The rectangle to union with.

Remarks

A Region can be used to clip drawing operations to a specific area. Regions support boolean operations like Union, Intersect, Exclude, Complement, and Xor.

Union(RectangleF)

Updates this region to the union of itself and the specified rectangle.

Declaration
public void Union(RectangleF rect)
Parameters
Type Name Description
RectangleF rect

The rectangle to union with.

Remarks

A Region can be used to clip drawing operations to a specific area. Regions support boolean operations like Union, Intersect, Exclude, Complement, and Xor.

Xor(GraphicsPath)

Updates this region to the exclusive OR of itself and the specified path.

Declaration
public void Xor(GraphicsPath path)
Parameters
Type Name Description
GraphicsPath path

The path to XOR with.

Remarks

A Region can be used to clip drawing operations to a specific area. Regions support boolean operations like Union, Intersect, Exclude, Complement, and Xor.

Xor(Region)

Updates this region to the exclusive OR of itself and the specified region.

Declaration
public void Xor(Region region)
Parameters
Type Name Description
Region region

The region to XOR with.

Remarks

A Region can be used to clip drawing operations to a specific area. Regions support boolean operations like Union, Intersect, Exclude, Complement, and Xor.

Xor(Rectangle)

Updates this region to the exclusive OR of itself and the specified rectangle.

Declaration
public void Xor(Rectangle rect)
Parameters
Type Name Description
Rectangle rect

The rectangle to XOR with.

Remarks

A Region can be used to clip drawing operations to a specific area. Regions support boolean operations like Union, Intersect, Exclude, Complement, and Xor.

Xor(RectangleF)

Updates this region to the exclusive OR of itself and the specified rectangle.

Declaration
public void Xor(RectangleF rect)
Parameters
Type Name Description
RectangleF rect

The rectangle to XOR with.

Remarks

A Region can be used to clip drawing operations to a specific area. Regions support boolean operations like Union, Intersect, Exclude, Complement, and Xor.

Implements

IDisposable
Back to top

DR-IT Software documentation

DR-IT Software · Products · Documentation index · Product page · Downloads · Support · Licensing

Generated by DocFX