xtd 0.2.0
Loading...
Searching...
No Matches
xtd::drawing::region Class Referencefinal
Inheritance diagram for xtd::drawing::region:
xtd::object xtd::iequatable< region > xtd::interface xtd::equality_operators< type_t, equatable_t >

Definition

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

class drawing_export_ region final : public xtd::object
Describes the interior of a graphics shape composed of rectangles and paths. This class cannot be inh...
Definition region.h:32
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.h:42
#define drawing_export_
Define shared library export.
Definition drawing_export.h:13
Inheritance
xtd::objectxtd::drawing::region
Namespace
xtd::drawing
Library
xtd.drawing
Remarks
A region is scalable because its coordinates are specified in world coordinates. On a drawing surface, however, its interior is dependent on the size and shape of the pixels representing it. An application can use regions to clip the output of drawing operations. These regions are called clipping regions. For more information on using regions for clipping,
An application can also use regions in hit-testing operations, such as checking whether a point or a rectangle intersects a region.
An application can fill a region by using the xtd::drawing::graphics::fill_region method and a xtd::drawing::brush object.
Examples
circular_form.cpp.

Public Constructors

 region ()
 Initializes a new xtd::drawing::region.
 
 region (const xtd::drawing::drawing_2d::graphics_path &path)
 Initializes a new xtd::drawing::region with the specified xtd::drawing::graphics_path.
 
 region (const xtd::drawing::rectangle &rect)
 Initializes a new xtd::drawing::region from the specified xtd::drawing::rectangle structure.
 
 region (const xtd::drawing::rectangle_f &rect)
 Initializes a new xtd::drawing::region from the specified xtd::drawing::rectangle_f structure.
 

Public Properties

intptr handle () const noexcept
 Gets the handle of the region.
 

Public Methods

void complement (const xtd::drawing::drawing_2d::graphics_path &path) noexcept
 Updates this xtd::drawing::region to contain the portion of the specified xtd::drawing::graphics_path that does not intersect with this xtd::drawing::region.
 
void complement (const xtd::drawing::rectangle &rect) noexcept
 Updates this xtd::drawing::region to contain the portion of the specified xtd::drawing::rectangle structure that does not intersect with this xtd::drawing::region.
 
void complement (const xtd::drawing::rectangle_f &rect) noexcept
 Updates this xtd::drawing::region to contain the portion of the specified xtd::drawing::rectangle_f structure that does not intersect with this xtd::drawing::region.
 
void complement (const xtd::drawing::region &region) noexcept
 Updates this xtd::drawing::region to contain the portion of the specified xtd::drawing::region that does not intersect with this xtd::drawing::region.
 
bool equals (const region &value) const noexcept override
 
void exclude (const xtd::drawing::drawing_2d::graphics_path &path) noexcept
 Updates this xtd::drawing::region to contain only the portion of its interior that does not intersect with the specified xtd::drawing::graphics_path.
 
void exclude (const xtd::drawing::rectangle &rect) noexcept
 Updates this xtd::drawing::region to contain only the portion of its interior that does not intersect with the specified xtd::drawing::rectangle structure.
 
void exclude (const xtd::drawing::rectangle_f &rect) noexcept
 The xtd::drawing::rectangle_f structure to exclude from this xtd::drawing::region.
 
void exclude (const xtd::drawing::region &region) noexcept
 Updates this xtd::drawing::region to contain only the portion of its interior that does not intersect with the specified xtd::drawing::region.
 
xtd::drawing::rectangle_f get_bounds () const noexcept
 Gets a xtd::drawing::rectangle_f structure that represents a rectangle that bounds this xtd::drawing::region on the drawing surface of a xtd::drawing::graphics object.
 
xtd::drawing::rectangle_f get_bounds (const xtd::drawing::graphics &g) const noexcept
 Gets a xtd::drawing::rectangle_f structure that represents a rectangle that bounds this xtd::drawing::region on the drawing surface of a xtd::drawing::graphics object.
 
intptr get_hrgn (const xtd::drawing::graphics &g) const noexcept
 Returns a Windows handle to this xtd::drawing::region in the specified graphics context.
 
void intersect (const xtd::drawing::drawing_2d::graphics_path &path) noexcept
 Updates this xtd::drawing::region to the intersection of itself with the specified xtd::drawing::graphics_path.
 
void intersect (const xtd::drawing::rectangle &rect) noexcept
 Updates this xtd::drawing::region to the intersection of itself with the specified xtd::drawing::rectangle structure.
 
void intersect (const xtd::drawing::rectangle_f &rect) noexcept
 Updates this xtd::drawing::region to the intersection of itself with the specified xtd::drawing::rectangle_f structure.
 
void intersect (const xtd::drawing::region &region) noexcept
 Updates this xtd::drawing::region to the intersection of itself with the specified xtd::drawing::region.
 
bool is_empty () const noexcept
 Tests whether this xtd::drawing::region has an empty interior.
 
bool is_empty (const xtd::drawing::graphics &g) const noexcept
 Tests whether this xtd::drawing::region has an empty interior on the specified drawing surface.
 
bool is_infinite () const noexcept
 Tests whether this xtd::drawing::region has an infinite interior.
 
bool is_infinite (const xtd::drawing::graphics &g) const noexcept
 Tests whether this xtd::drawing::region has an infinite interior on the specified drawing surface.
 
bool is_visible (const xtd::drawing::rectangle_f &rect, const xtd::drawing::graphics &g) const noexcept
 Tests whether any portion of the specified xtd::drawing::rectangle_f structure is contained within this xtd::drawing::region when drawn using the specified xtd::drawing::graphics.
 
bool is_visible (float x, float y, float width, float height, const xtd::drawing::graphics &g) const noexcept
 Tests whether any portion of the specified rectangle is contained within this xtd::drawing::region when drawn using the specified xtd::drawing::graphics.
 
bool is_visible (const xtd::drawing::rectangle &rect, const xtd::drawing::graphics &g) const noexcept
 Tests whether any portion of the specified xtd::drawing::rectangle structure is contained within this xtd::drawing::region when drawn using the specified xtd::drawing::graphics.
 
bool is_visible (int32 x, int32 y, int32 width, int32 height, const xtd::drawing::graphics &g) const noexcept
 Tests whether any portion of the specified rectangle is contained within this xtd::drawing::region when drawn using the specified xtd::drawing::graphics.
 
bool is_visible (const xtd::drawing::rectangle_f &rect) const noexcept
 Tests whether any portion of the specified xtd::drawing::rectangle_f structure is contained within this xtd::drawing::region.
 
bool is_visible (float x, float y, float width, float height) const noexcept
 Tests whether any portion of the specified rectangle is contained within this xtd::drawing::region.
 
bool is_visible (const xtd::drawing::rectangle &rect) const noexcept
 Tests whether any portion of the specified xtd::drawing::rectangle structure is contained within this xtd::drawing::region.
 
bool is_visible (int32 x, int32 y, int32 width, int32 height) const noexcept
 Tests whether any portion of the specified rectangle is contained within this xtd::drawing::region.
 
bool is_visible (xtd::drawing::point_f pt, const xtd::drawing::graphics &g) const noexcept
 Tests whether the specified PointF structure is contained within this xtd::drawing::region when drawn using the specified xtd::drawing::graphics.
 
bool is_visible (float x, float y, const xtd::drawing::graphics &g) const noexcept
 Tests whether the specified point is contained within this xtd::drawing::region when drawn using the specified xtd::drawing::graphics.
 
bool is_visible (xtd::drawing::point pt, const xtd::drawing::graphics &g) const noexcept
 Tests whether the specified Point structure is contained within this xtd::drawing::region when drawn using the specified xtd::drawing::graphics.
 
bool is_visible (int32 x, int32 y, const xtd::drawing::graphics &g) const noexcept
 Tests whether the specified point is contained within this xtd::drawing::region when drawn using the specified xtd::drawing::graphics.
 
bool is_visible (xtd::drawing::point_f pt) const noexcept
 Tests whether the specified PointF structure is contained within this xtd::drawing::region.
 
bool is_visible (float x, float y) const noexcept
 Tests whether the specified point is contained within this xtd::drawing::region when drawn using the specified xtd::drawing::graphics.
 
bool is_visible (xtd::drawing::point pt) const noexcept
 Tests whether the specified Point structure is contained within this xtd::drawing::region.
 
bool is_visible (int32 x, int32 y) const noexcept
 Tests whether the specified point is contained within this xtd::drawing::region when drawn using the specified xtd::drawing::graphics.
 
void make_empty ()
 Initializes this xtd::drawing::region to an empty interior.
 
void make_infinite () noexcept
 Initializes this xtd::drawing::region object to an infinite interior.
 
void make_union (const xtd::drawing::drawing_2d::graphics_path &path) noexcept
 Updates this xtd::drawing::region to the union of itself and the specified xtd::drawing::graphics_path.
 
void make_union (const xtd::drawing::rectangle &rect) noexcept
 Updates this xtd::drawing::region to the union of itself and the specified xtd::drawing::rectangle structure.
 
void make_union (const xtd::drawing::rectangle_f &rect) noexcept
 Updates this xtd::drawing::region to the union of itself and the specified xtd::drawing::rectangle_f structure.
 
void make_union (const xtd::drawing::region &region) noexcept
 Updates this xtd::drawing::region to the union of itself and the specified xtd::drawing::region.
 
void make_xor (const xtd::drawing::drawing_2d::graphics_path &path) noexcept
 Updates this xtd::drawing::region to the union minus the intersection of itself with the specified xtd::drawing::graphics_path.
 
void make_xor (const xtd::drawing::rectangle &rect) noexcept
 Updates this xtd::drawing::region to the union minus the intersection of itself with the specified xtd::drawing::rectangle structure.
 
void make_xor (const xtd::drawing::rectangle_f &rect) noexcept
 Updates this xtd::drawing::region to the union minus the intersection of itself with the specified xtd::drawing::rectangle_f structure.
 
void make_xor (const xtd::drawing::region &region) noexcept
 Updates this xtd::drawing::region to the union minus the intersection of itself with the specified xtd::drawing::region.
 
void release_hrgn (intptr region_handle)
 Releases the handle of the xtd::drawing::region.
 
void translate (int32 dx, int32 dy) noexcept
 Offsets the coordinates of this xtd::drawing::region by the specified amount.
 
void translate (float dx, float dy) noexcept
 Offsets the coordinates of this xtd::drawing::region by the specified amount.
 
virtual bool equals (const object &obj) const noexcept
 Determines whether the specified object is equal to the current object.
 
template<typename object_a_t , typename object_b_t >
static bool equals (const object_a_t &object_a, const object_b_t &object_b) noexcept
 Determines whether the specified object instances are considered equal.
 

Public Static Methods

static xtd::drawing::region from_hrgn (intptr hrgn)
 Initializes a new xtd::drawing::region from a handle to the specified existing GDI region.
 

Additional Inherited Members

- Public Member Functions inherited from xtd::object
 object ()=default
 Create a new instance of the ultimate base class object.
 
virtual size_t get_hash_code () const noexcept
 Serves as a hash function for a particular type.
 
virtual type_object get_type () const noexcept
 Gets the type of the current instance.
 
template<typename object_t >
xtd::uptr< object_t > memberwise_clone () const
 Creates a shallow copy of the current object.
 
virtual xtd::string to_string () const noexcept
 Returns a xtd::string that represents the current object.
 
- Public Member Functions inherited from xtd::iequatable< region >
virtual bool equals (const region &) const noexcept=0
 Indicates whether the current object is equal to another object of the same type.
 
- Static Public Member Functions inherited from xtd::object
template<typename object_a_t , typename object_b_t >
static bool equals (const object_a_t &object_a, const object_b_t &object_b) noexcept
 Determines whether the specified object instances are considered equal.
 
template<typename object_a_t , typename object_b_t >
static bool reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept
 Determines whether the specified object instances are the same instance.
 

Constructor & Destructor Documentation

◆ region() [1/4]

xtd::drawing::region::region ( )

Initializes a new xtd::drawing::region.

Remarks
This constructor initializes a new xtd::drawing::region with an infinite interior.

◆ region() [2/4]

xtd::drawing::region::region ( const xtd::drawing::drawing_2d::graphics_path path)
explicit

Initializes a new xtd::drawing::region with the specified xtd::drawing::graphics_path.

Parameters
pathA xtd::drawing::graphics_path that defines the new xtd::drawing::region.
Remarks
This method creates a new xtd::drawing::region with a xtd::drawing::graphics_path. The new region is defined as the interior of the xtd::drawing::graphics_path specified by the path parameter.

◆ region() [3/4]

xtd::drawing::region::region ( const xtd::drawing::rectangle rect)
explicit

Initializes a new xtd::drawing::region from the specified xtd::drawing::rectangle structure.

Parameters
rectA xtd::drawing::rectangle structure that defines the interior of the new xtd::drawing::region.
Remarks
This method creates a new xtd::drawing::region with a rectangular interior. The interior is defined by the rect parameter.

◆ region() [4/4]

xtd::drawing::region::region ( const xtd::drawing::rectangle_f rect)
explicit

Initializes a new xtd::drawing::region from the specified xtd::drawing::rectangle_f structure.

Parameters
rectA xtd::drawing::rectangle_f structure that defines the interior of the new xtd::drawing::region.
Remarks
This method creates a new xtd::drawing::region with a rectangular interior. The interior is defined by the rect parameter.

Member Function Documentation

◆ handle()

intptr xtd::drawing::region::handle ( ) const
noexcept

Gets the handle of the region.

Returns
An intptr that contains the handle of the region.

◆ complement() [1/4]

void xtd::drawing::region::complement ( const xtd::drawing::drawing_2d::graphics_path path)
noexcept

Updates this xtd::drawing::region to contain the portion of the specified xtd::drawing::graphics_path that does not intersect with this xtd::drawing::region.

Parameters
pathThe xtd::drawing::graphics_path to complement this xtd::drawing::region.

◆ complement() [2/4]

void xtd::drawing::region::complement ( const xtd::drawing::rectangle rect)
noexcept

Updates this xtd::drawing::region to contain the portion of the specified xtd::drawing::rectangle structure that does not intersect with this xtd::drawing::region.

Parameters
rectThe xtd::drawing::rectangle structure to complement this xtd::drawing::region.

◆ complement() [3/4]

void xtd::drawing::region::complement ( const xtd::drawing::rectangle_f rect)
noexcept

Updates this xtd::drawing::region to contain the portion of the specified xtd::drawing::rectangle_f structure that does not intersect with this xtd::drawing::region.

Parameters
rectThe xtd::drawing::rectangle_f structure to complement this xtd::drawing::region.

◆ complement() [4/4]

void xtd::drawing::region::complement ( const xtd::drawing::region region)
noexcept

Updates this xtd::drawing::region to contain the portion of the specified xtd::drawing::region that does not intersect with this xtd::drawing::region.

Parameters
regionThe xtd::drawing::region object to complement this xtd::drawing::region object.

◆ exclude() [1/4]

void xtd::drawing::region::exclude ( const xtd::drawing::drawing_2d::graphics_path path)
noexcept

Updates this xtd::drawing::region to contain only the portion of its interior that does not intersect with the specified xtd::drawing::graphics_path.

Parameters
pathThe xtd::drawing::graphics_path to exclude from this xtd::drawing::region.

◆ exclude() [2/4]

void xtd::drawing::region::exclude ( const xtd::drawing::rectangle rect)
noexcept

Updates this xtd::drawing::region to contain only the portion of its interior that does not intersect with the specified xtd::drawing::rectangle structure.

Parameters
rectThe xtd::drawing::rectangle structure to exclude from this xtd::drawing::region.

◆ exclude() [3/4]

void xtd::drawing::region::exclude ( const xtd::drawing::rectangle_f rect)
noexcept

The xtd::drawing::rectangle_f structure to exclude from this xtd::drawing::region.

◆ exclude() [4/4]

void xtd::drawing::region::exclude ( const xtd::drawing::region region)
noexcept

Updates this xtd::drawing::region to contain only the portion of its interior that does not intersect with the specified xtd::drawing::region.

Parameters
regionThe xtd::drawing::region to exclude from this xtd::drawing::region.

◆ get_bounds() [1/2]

xtd::drawing::rectangle_f xtd::drawing::region::get_bounds ( ) const
noexcept

Gets a xtd::drawing::rectangle_f structure that represents a rectangle that bounds this xtd::drawing::region on the drawing surface of a xtd::drawing::graphics object.

Parameters
gThe xtd::drawing::graphics on which this xtd::drawing::region is drawn.
Returns
A xtd::drawing::rectangle_f structure that represents the bounding rectangle for this xtd::drawing::region in pixels.
Remarks
The current transformation of the graphics context is used to compute the region interior on the drawing surface. The bounding rectangle is not always the smallest possible bounding rectangle depending on the current transformation.

◆ get_bounds() [2/2]

xtd::drawing::rectangle_f xtd::drawing::region::get_bounds ( const xtd::drawing::graphics g) const
noexcept

Gets a xtd::drawing::rectangle_f structure that represents a rectangle that bounds this xtd::drawing::region on the drawing surface of a xtd::drawing::graphics object.

Parameters
gThe xtd::drawing::graphics on which this xtd::drawing::region is drawn.
Returns
A xtd::drawing::rectangle_f structure that represents the bounding rectangle for this xtd::drawing::region on the specified drawing surface.
Remarks
The current transformation of the graphics context is used to compute the region interior on the drawing surface. The bounding rectangle is not always the smallest possible bounding rectangle depending on the current transformation.

◆ get_hrgn()

intptr xtd::drawing::region::get_hrgn ( const xtd::drawing::graphics g) const
noexcept

Returns a Windows handle to this xtd::drawing::region in the specified graphics context.

Parameters
gThe xtd::drawing::graphics on which this xtd::drawing::region is drawn.
Returns
A Windows handle to this xtd::drawing::region.
Remarks
You are responsible for calling the xtd::region::release_hrgn method to free the memory used by the GDI region object.

◆ intersect() [1/4]

void xtd::drawing::region::intersect ( const xtd::drawing::drawing_2d::graphics_path path)
noexcept

Updates this xtd::drawing::region to the intersection of itself with the specified xtd::drawing::graphics_path.

Parameters
pathThe xtd::drawing::graphics_path to intersect with this xtd::drawing::region.

◆ intersect() [2/4]

void xtd::drawing::region::intersect ( const xtd::drawing::rectangle rect)
noexcept

Updates this xtd::drawing::region to the intersection of itself with the specified xtd::drawing::rectangle structure.

Parameters
Thextd::drawing::rectangle structure to intersect with this xtd::drawing::region.

◆ intersect() [3/4]

void xtd::drawing::region::intersect ( const xtd::drawing::rectangle_f rect)
noexcept

Updates this xtd::drawing::region to the intersection of itself with the specified xtd::drawing::rectangle_f structure.

Parameters
rectThe xtd::drawing::rectangle_f structure to intersect with this xtd::drawing::region.

◆ intersect() [4/4]

void xtd::drawing::region::intersect ( const xtd::drawing::region region)
noexcept

Updates this xtd::drawing::region to the intersection of itself with the specified xtd::drawing::region.

Parameters
regionThe xtd::drawing::region to intersect with this xtd::drawing::region.

◆ is_empty() [1/2]

bool xtd::drawing::region::is_empty ( ) const
noexcept

Tests whether this xtd::drawing::region has an empty interior.

Returns
true if the interior of this xtd::drawing::region is empty; otherwise, false.
Remarks
The current transformation of the graphics context g is used to compute the region interior on the drawing surface.

◆ is_empty() [2/2]

bool xtd::drawing::region::is_empty ( const xtd::drawing::graphics g) const
noexcept

Tests whether this xtd::drawing::region has an empty interior on the specified drawing surface.

Parameters
gA xtd::drawing::graphics that represents a drawing surface.
Returns
true if the interior of this xtd::drawing::region is empty when the transformation associated with g is applied; otherwise, false.
Remarks
The current transformation of the graphics context g is used to compute the region interior on the drawing surface.

◆ is_infinite() [1/2]

bool xtd::drawing::region::is_infinite ( ) const
noexcept

Tests whether this xtd::drawing::region has an infinite interior.

Returns
true if the interior of this xtd::drawing::region is infinite; otherwise, false.
Remarks
The current transformation of the graphics context g is used to compute the region interior on the drawing surface.

◆ is_infinite() [2/2]

bool xtd::drawing::region::is_infinite ( const xtd::drawing::graphics g) const
noexcept

Tests whether this xtd::drawing::region has an infinite interior on the specified drawing surface.

Parameters
gA xtd::drawing::graphics that represents a drawing surface.
Returns
true if the interior of this xtd::drawing::region is infinite when the transformation associated with g is applied; otherwise, false.
Remarks
The current transformation of the graphics context g is used to compute the region interior on the drawing surface.

◆ is_visible() [1/16]

bool xtd::drawing::region::is_visible ( const xtd::drawing::rectangle_f rect,
const xtd::drawing::graphics g 
) const
noexcept

Tests whether any portion of the specified xtd::drawing::rectangle_f structure is contained within this xtd::drawing::region when drawn using the specified xtd::drawing::graphics.

Parameters
rectThe xtd::drawing::rectangle_f structure to test.
gA xtd::drawing::graphics that represents a graphics context.
Returns
true when any portion of the rect is contained within this xtd::drawing::region; otherwise, false.
Remarks
The current transformation of the graphics context is used to compute the region interior and the rectangle coordinates on the drawing surface.

◆ is_visible() [2/16]

bool xtd::drawing::region::is_visible ( float  x,
float  y,
float  width,
float  height,
const xtd::drawing::graphics g 
) const
noexcept

Tests whether any portion of the specified rectangle is contained within this xtd::drawing::region when drawn using the specified xtd::drawing::graphics.

Parameters
xThe x-coordinate of the upper-left corner of the rectangle to test.
yThe y-coordinate of the upper-left corner of the rectangle to test.
widthThe width of the rectangle to test.
heightThe height of the rectangle to test.
gA xtd::drawing::graphics that represents a graphics context.
Returns
true when any portion of the specified rectangle is contained within this xtd::drawing::region; otherwise, false.
Remarks
The current transformation of the graphics context is used to compute the region interior and the rectangle coordinates on the drawing surface.

◆ is_visible() [3/16]

bool xtd::drawing::region::is_visible ( const xtd::drawing::rectangle rect,
const xtd::drawing::graphics g 
) const
noexcept

Tests whether any portion of the specified xtd::drawing::rectangle structure is contained within this xtd::drawing::region when drawn using the specified xtd::drawing::graphics.

Parameters
rectThe xtd::drawing::rectangle structure to test.
gA xtd::drawing::graphics that represents a graphics context.
Returns
true when any portion of the rect is contained within this xtd::drawing::region; otherwise, false.
Remarks
The current transformation of the graphics context is used to compute the region interior and the rectangle coordinates on the drawing surface.

◆ is_visible() [4/16]

bool xtd::drawing::region::is_visible ( int32  x,
int32  y,
int32  width,
int32  height,
const xtd::drawing::graphics g 
) const
noexcept

Tests whether any portion of the specified rectangle is contained within this xtd::drawing::region when drawn using the specified xtd::drawing::graphics.

Parameters
xThe x-coordinate of the upper-left corner of the rectangle to test.
yThe y-coordinate of the upper-left corner of the rectangle to test.
widthThe width of the rectangle to test.
heightThe height of the rectangle to test.
gA xtd::drawing::graphics that represents a graphics context.
Returns
true when any portion of the specified rectangle is contained within this xtd::drawing::region; otherwise, false.
Remarks
The current transformation of the graphics context is used to compute the region interior and the rectangle coordinates on the drawing surface.

◆ is_visible() [5/16]

bool xtd::drawing::region::is_visible ( const xtd::drawing::rectangle_f rect) const
noexcept

Tests whether any portion of the specified xtd::drawing::rectangle_f structure is contained within this xtd::drawing::region.

Parameters
rectThe xtd::drawing::rectangle_f structure to test.
Returns
true when any portion of rect is contained within this xtd::drawing::region; otherwise, false.

◆ is_visible() [6/16]

bool xtd::drawing::region::is_visible ( float  x,
float  y,
float  width,
float  height 
) const
noexcept

Tests whether any portion of the specified rectangle is contained within this xtd::drawing::region.

Parameters
xThe x-coordinate of the upper-left corner of the rectangle to test.
yThe y-coordinate of the upper-left corner of the rectangle to test.
widthThe width of the rectangle to test.
heightThe height of the rectangle to test.
Returns
true when any portion of the specified rectangle is contained within this xtd::drawing::region; otherwise, false.

◆ is_visible() [7/16]

bool xtd::drawing::region::is_visible ( const xtd::drawing::rectangle rect) const
noexcept

Tests whether any portion of the specified xtd::drawing::rectangle structure is contained within this xtd::drawing::region.

Parameters
rectThe xtd::drawing::rectangle structure to test.
Returns
true when any portion of rect is contained within this xtd::drawing::region; otherwise, false.

◆ is_visible() [8/16]

bool xtd::drawing::region::is_visible ( int32  x,
int32  y,
int32  width,
int32  height 
) const
noexcept

Tests whether any portion of the specified rectangle is contained within this xtd::drawing::region.

Parameters
xThe x-coordinate of the upper-left corner of the rectangle to test.
yThe y-coordinate of the upper-left corner of the rectangle to test.
widthThe width of the rectangle to test.
heightThe height of the rectangle to test.
Returns
true when any portion of the specified rectangle is contained within this xtd::drawing::region; otherwise, false.

◆ is_visible() [9/16]

bool xtd::drawing::region::is_visible ( xtd::drawing::point_f  pt,
const xtd::drawing::graphics g 
) const
noexcept

Tests whether the specified PointF structure is contained within this xtd::drawing::region when drawn using the specified xtd::drawing::graphics.

Parameters
ptThe PointF structure to test.
gA xtd::drawing::graphics that represents a graphics context.
Returns
true when point is contained within this xtd::drawing::region; otherwise, false.
Remarks
The current transformation of the graphics context is used to compute the region interior and the rectangle coordinates on the drawing surface.

◆ is_visible() [10/16]

bool xtd::drawing::region::is_visible ( float  x,
float  y,
const xtd::drawing::graphics g 
) const
noexcept

Tests whether the specified point is contained within this xtd::drawing::region when drawn using the specified xtd::drawing::graphics.

Parameters
xThe x-coordinate of the point to test.
yThe y-coordinate of the point to test.
gA xtd::drawing::graphics that represents a graphics context.
Returns
true when the specified point is contained within this xtd::drawing::region; otherwise, false.
Remarks
The current transformation of the graphics context is used to compute the region interior and the rectangle coordinates on the drawing surface.

◆ is_visible() [11/16]

bool xtd::drawing::region::is_visible ( xtd::drawing::point  pt,
const xtd::drawing::graphics g 
) const
noexcept

Tests whether the specified Point structure is contained within this xtd::drawing::region when drawn using the specified xtd::drawing::graphics.

Parameters
ptThe Point structure to test.
gA xtd::drawing::graphics that represents a graphics context.
Returns
true when point is contained within this xtd::drawing::region; otherwise, false.
Remarks
The current transformation of the graphics context is used to compute the region interior and the rectangle coordinates on the drawing surface.

◆ is_visible() [12/16]

bool xtd::drawing::region::is_visible ( int32  x,
int32  y,
const xtd::drawing::graphics g 
) const
noexcept

Tests whether the specified point is contained within this xtd::drawing::region when drawn using the specified xtd::drawing::graphics.

Parameters
xThe x-coordinate of the point to test.
yThe y-coordinate of the point to test.
gA xtd::drawing::graphics that represents a graphics context.
Returns
true when the specified point is contained within this xtd::drawing::region; otherwise, false.
Remarks
The current transformation of the graphics context is used to compute the region interior and the rectangle coordinates on the drawing surface.

◆ is_visible() [13/16]

bool xtd::drawing::region::is_visible ( xtd::drawing::point_f  pt) const
noexcept

Tests whether the specified PointF structure is contained within this xtd::drawing::region.

Parameters
ptThe PointF structure to test.
Returns
true when point is contained within this xtd::drawing::region; otherwise, false.

◆ is_visible() [14/16]

bool xtd::drawing::region::is_visible ( float  x,
float  y 
) const
noexcept

Tests whether the specified point is contained within this xtd::drawing::region when drawn using the specified xtd::drawing::graphics.

Parameters
xThe x-coordinate of the point to test.
yThe y-coordinate of the point to test.
Returns
true when the specified point is contained within this xtd::drawing::region; otherwise, false.

◆ is_visible() [15/16]

bool xtd::drawing::region::is_visible ( xtd::drawing::point  pt) const
noexcept

Tests whether the specified Point structure is contained within this xtd::drawing::region.

Parameters
ptThe Point structure to test.
Returns
true when point is contained within this xtd::drawing::region; otherwise, false.

◆ is_visible() [16/16]

bool xtd::drawing::region::is_visible ( int32  x,
int32  y 
) const
noexcept

Tests whether the specified point is contained within this xtd::drawing::region when drawn using the specified xtd::drawing::graphics.

Parameters
xThe x-coordinate of the point to test.
yThe y-coordinate of the point to test.
Returns
true when the specified point is contained within this xtd::drawing::region; otherwise, false.

◆ make_empty()

void xtd::drawing::region::make_empty ( )

Initializes this xtd::drawing::region to an empty interior.

◆ make_infinite()

void xtd::drawing::region::make_infinite ( )
noexcept

Initializes this xtd::drawing::region object to an infinite interior.

◆ make_union() [1/4]

void xtd::drawing::region::make_union ( const xtd::drawing::drawing_2d::graphics_path path)
noexcept

Updates this xtd::drawing::region to the union of itself and the specified xtd::drawing::graphics_path.

Parameters
pathThe xtd::drawing::graphics_path to unite with this xtd::drawing::region.

◆ make_union() [2/4]

void xtd::drawing::region::make_union ( const xtd::drawing::rectangle rect)
noexcept

Updates this xtd::drawing::region to the union of itself and the specified xtd::drawing::rectangle structure.

Parameters
rectThe xtd::drawing::rectangle structure to unite with this xtd::drawing::region.

◆ make_union() [3/4]

void xtd::drawing::region::make_union ( const xtd::drawing::rectangle_f rect)
noexcept

Updates this xtd::drawing::region to the union of itself and the specified xtd::drawing::rectangle_f structure.

Parameters
rectThe xtd::drawing::rectangle_f structure to unite with this xtd::drawing::region.

◆ make_union() [4/4]

void xtd::drawing::region::make_union ( const xtd::drawing::region region)
noexcept

Updates this xtd::drawing::region to the union of itself and the specified xtd::drawing::region.

Parameters
regionThe xtd::drawing::region to unite with this xtd::drawing::region.

◆ make_xor() [1/4]

void xtd::drawing::region::make_xor ( const xtd::drawing::drawing_2d::graphics_path path)
noexcept

Updates this xtd::drawing::region to the union minus the intersection of itself with the specified xtd::drawing::graphics_path.

Parameters
pathThe xtd::drawing::graphics_path to Xor with this xtd::drawing::region.

◆ make_xor() [2/4]

void xtd::drawing::region::make_xor ( const xtd::drawing::rectangle rect)
noexcept

Updates this xtd::drawing::region to the union minus the intersection of itself with the specified xtd::drawing::rectangle structure.

Parameters
pathThe xtd::drawing::rectangle structure to Xor with this xtd::drawing::region.

◆ make_xor() [3/4]

void xtd::drawing::region::make_xor ( const xtd::drawing::rectangle_f rect)
noexcept

Updates this xtd::drawing::region to the union minus the intersection of itself with the specified xtd::drawing::rectangle_f structure.

Parameters
pathThe xtd::drawing::rectangle_f structure to Xor with this xtd::drawing::region.

◆ make_xor() [4/4]

void xtd::drawing::region::make_xor ( const xtd::drawing::region region)
noexcept

Updates this xtd::drawing::region to the union minus the intersection of itself with the specified xtd::drawing::region.

Parameters
pathThe xtd::drawing::region to Xor with this xtd::drawing::region.

◆ release_hrgn()

void xtd::drawing::region::release_hrgn ( intptr  region_handle)

Releases the handle of the xtd::drawing::region.

Parameters
region_handleThe handle to the xtd::drawing::region.

◆ translate() [1/2]

void xtd::drawing::region::translate ( int32  dx,
int32  dy 
)
noexcept

Offsets the coordinates of this xtd::drawing::region by the specified amount.

Parameters
dxThe amount to offset this xtd::drawing::region horizontally.
dyThe amount to offset this xtd::drawing::region vertically.

◆ translate() [2/2]

void xtd::drawing::region::translate ( float  dx,
float  dy 
)
noexcept

Offsets the coordinates of this xtd::drawing::region by the specified amount.

Parameters
dxThe amount to offset this xtd::drawing::region horizontally.
dyThe amount to offset this xtd::drawing::region vertically.

◆ from_hrgn()

static xtd::drawing::region xtd::drawing::region::from_hrgn ( intptr  hrgn)
static

Initializes a new xtd::drawing::region from a handle to the specified existing GDI region.

Parameters
hrgnA handle to an existing xtd::drawing::region.
Returns
The new xtd::drawing::region.
Remarks
This method creates a new xtd::drawing::region with an interior defined by the existing xtd::drawing::region referred to by the handle in the hrgn parameter.

◆ equals() [1/2]

virtual bool xtd::object::equals ( const object obj) const
virtualnoexcept

Determines whether the specified object is equal to the current object.

Parameters
objThe object to compare with the current object.
Returns
true if the specified object is equal to the current object. otherwise, false.
Examples
The following code example compares the current instance with another object.
#include <xtd/console>
using namespace xtd;
auto main() -> int {
auto object1 = new_ptr<object>();
auto object2 = new_ptr<object>();
auto object3 = object2;
console::write_line(object1->equals(*object3));
console::write_line(*object1 == *object3);
object3 = object1;
console::write_line(object1->equals(*object3));
console::write_line(*object1 == *object3);
}
// This code produces the following output :
//
// false
// false
// true
// true
static void write_line()
Writes the current line terminator to the standard output stream using the specified format informati...
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10

Reimplemented from xtd::object.

◆ equals() [2/2]

template<typename object_a_t , typename object_b_t >
static bool xtd::object::equals ( const object_a_t &  object_a,
const object_b_t &  object_b 
)
inlinestaticnoexcept

Determines whether the specified object instances are considered equal.

Parameters
object_aThe first object to compare.
object_bThe second object to compare.
Returns
true if object_a is the same instance as object_b or if both are null references or if object_a(object_b) returns true. otherwise, false.
Examples
The following code example compares different objects.
#include <xtd/console>
using namespace xtd;
auto main() -> int {
string s1 = "Tom";
string s2 = "Carol";
console::write_line("object::equals(\"{0}\", \"{1}\") => {2}", s1, s2, object::equals(s1, s2));
s1 = "Tom";
s2 = "Tom";
console::write_line("object::equals(\"{0}\", \"{1}\") => {2}", s1, s2, object::equals(s1, s2));
s1 = "";
s2 = "Tom";
console::write_line("object::equals(\"{0}\", \"{1}\") => {2}", s1, s2, object::equals(s1, s2));
s1 = "Carol";
s2 = "";
console::write_line("object::equals(\"{0}\", \"{1}\") => {2}", s1, s2, object::equals(s1, s2));
s1 = "";
s2 = "";
console::write_line("object::equals(\"{0}\", \"{1}\") => {2}", s1, s2, object::equals(s1, s2));
}
// This code produces the following output :
//
// object::equals("Tom", "Carol") => false
// object::equals("Tom", "Tom") => true
// object::equals("", "Tom") => false
// object::equals("Carol", "") => false
// object::equals("", "") => true
virtual bool equals(const object &obj) const noexcept
Determines whether the specified object is equal to the current object.

The documentation for this class was generated from the following file: