xtd 0.2.0
region.hpp
Go to the documentation of this file.
1
4#pragma once
7#include <xtd/iequatable>
8#include <xtd/object>
9
11namespace xtd {
13 namespace drawing {
15 class graphics;
17
32 class drawing_export_ region final : public xtd::object, public xtd::iequatable<region> {
33 struct data;
34
35 public:
37
49 explicit region(const xtd::drawing::rectangle& rect);
53 explicit region(const xtd::drawing::rectangle_f& rect);
55
57 region(const region& value) = default;
58 region& operator =(const region& value) = default;
59 ~region();
61
63
67 intptr handle() const noexcept;
69
71
75 void complement(const xtd::drawing::drawing_2d::graphics_path& path) noexcept;
78 void complement(const xtd::drawing::rectangle& rect) noexcept;
81 void complement(const xtd::drawing::rectangle_f& rect) noexcept;
84 void complement(const xtd::drawing::region& region) noexcept;
85
89 bool equals(const xtd::object& obj) const noexcept override;
93 bool equals(const region& other) const noexcept override;
94
97 xtd::size get_hash_code() const noexcept override;
98
101 void exclude(const xtd::drawing::drawing_2d::graphics_path& path) noexcept;
104 void exclude(const xtd::drawing::rectangle& rect) noexcept;
106 void exclude(const xtd::drawing::rectangle_f& rect) noexcept;
109 void exclude(const xtd::drawing::region& region) noexcept;
110
115 xtd::drawing::rectangle_f get_bounds() const noexcept;
120 xtd::drawing::rectangle_f get_bounds(const xtd::drawing::graphics& g) const noexcept;
121
126 intptr get_hrgn(const xtd::drawing::graphics& g) const noexcept;
127
130 void intersect(const xtd::drawing::drawing_2d::graphics_path& path) noexcept;
133 void intersect(const xtd::drawing::rectangle& rect) noexcept;
136 void intersect(const xtd::drawing::rectangle_f& rect) noexcept;
139 void intersect(const xtd::drawing::region& region) noexcept;
140
144 bool is_empty() const noexcept;
149 bool is_empty(const xtd::drawing::graphics& g) const noexcept;
150
154 bool is_infinite() const noexcept;
159 bool is_infinite(const xtd::drawing::graphics& g) const noexcept;
160
166 bool is_visible(const xtd::drawing::rectangle_f& rect, const xtd::drawing::graphics& g) const noexcept;
175 bool is_visible(float x, float y, float width, float height, const xtd::drawing::graphics& g) const noexcept;
181 bool is_visible(const xtd::drawing::rectangle& rect, const xtd::drawing::graphics& g) const noexcept;
190 bool is_visible(int32 x, int32 y, int32 width, int32 height, const xtd::drawing::graphics& g) const noexcept;
194 bool is_visible(const xtd::drawing::rectangle_f& rect) const noexcept;
201 bool is_visible(float x, float y, float width, float height) const noexcept;
205 bool is_visible(const xtd::drawing::rectangle& rect) const noexcept;
212 bool is_visible(int32 x, int32 y, int32 width, int32 height) const noexcept;
218 bool is_visible(xtd::drawing::point_f pt, const xtd::drawing::graphics& g) const noexcept;
225 bool is_visible(float x, float y, const xtd::drawing::graphics& g) const noexcept;
231 bool is_visible(xtd::drawing::point pt, const xtd::drawing::graphics& g) const noexcept;
238 bool is_visible(int32 x, int32 y, const xtd::drawing::graphics& g) const noexcept;
242 bool is_visible(xtd::drawing::point_f pt) const noexcept;
247 bool is_visible(float x, float y) const noexcept;
251 bool is_visible(xtd::drawing::point pt) const noexcept;
256 bool is_visible(int32 x, int32 y) const noexcept;
257
260
262 void make_infinite() noexcept;
263
266 void make_union(const xtd::drawing::drawing_2d::graphics_path& path) noexcept;
269 void make_union(const xtd::drawing::rectangle& rect) noexcept;
272 void make_union(const xtd::drawing::rectangle_f& rect) noexcept;
275 void make_union(const xtd::drawing::region& region) noexcept;
276
279 void make_xor(const xtd::drawing::drawing_2d::graphics_path& path) noexcept;
282 void make_xor(const xtd::drawing::rectangle& rect) noexcept;
285 void make_xor(const xtd::drawing::rectangle_f& rect) noexcept;
288 void make_xor(const xtd::drawing::region& region) noexcept;
289
292 void release_hrgn(intptr region_handle);
293
297 void translate(int32 dx, int32 dy) noexcept;
301 void translate(float dx, float dy) noexcept;
303
305
312 static bool equals(const region& region, const xtd::drawing::graphics& g) noexcept;
313
320
321 private:
322 xtd::sptr<data> data_;
323 };
324 }
325}
Defines an object used to draw lines and curves. This class cannot be inherited.
Definition graphics_path.hpp:33
Defines an object used to draw lines and curves. This class cannot be inherited.
Definition graphics.hpp:67
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 th...
region()
Initializes a new xtd::drawing::region.
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...
region(const xtd::drawing::rectangle_f &rect)
Initializes a new xtd::drawing::region from the specified xtd::drawing::rectangle_f structure.
bool equals(const xtd::object &obj) const noexcept override
Determines whether the specified object is equal to the current object.
region(const xtd::drawing::drawing_2d::graphics_path &path)
Initializes a new xtd::drawing::region with the specified xtd::drawing::graphics_path.
bool is_empty() const noexcept
Tests whether this xtd::drawing::region has an empty interior.
intptr get_hrgn(const xtd::drawing::graphics &g) const noexcept
Returns a Windows handle to this xtd::drawing::region in the specified graphics context.
xtd::size get_hash_code() const noexcept override
Serves as a hash function for a particular type.
void make_infinite() noexcept
Initializes this xtd::drawing::region object to an infinite interior.
bool is_infinite() const noexcept
Tests whether this xtd::drawing::region has an infinite interior.
static xtd::drawing::region from_hrgn(intptr hrgn)
Initializes a new xtd::drawing::region from a handle to the specified existing GDI 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 xt...
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...
void translate(int32 dx, int32 dy) noexcept
Offsets the coordinates of this xtd::drawing::region by the specified amount.
intptr handle() const noexcept
Gets the handle of the region.
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::grap...
region(const xtd::drawing::rectangle &rect)
Initializes a new xtd::drawing::region from the specified xtd::drawing::rectangle structure.
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_pat...
void make_empty()
Initializes this xtd::drawing::region to an empty interior.
xtd::drawing::rectangle_f get_bounds() const noexcept
Gets a xtd::drawing::rectangle_f structure that represents a rectangle that bounds this xtd::drawing:...
void release_hrgn(intptr region_handle)
Releases the handle of the xtd::drawing::region.
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.hpp:22
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:44
Contains drawing_export_ keyword.
Contains xtd::drawing::drawing_2d::graphics_path class.
#define drawing_export_
Define shared library export.
Definition drawing_export.hpp:13
xtd::shared_ptr_object< type_t > sptr
The xtd::sptr object is a shared pointer.
Definition sptr.hpp:25
int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:23
intmax_t intptr
Represent a pointer or a handle.
Definition intptr.hpp:23
@ path
The xtd::uri::local_path data.
Definition uri_components.hpp:27
@ other
The operating system is other.
Definition platform_id.hpp:58
@ y
The Y key.
Definition console_key.hpp:136
@ x
The X key.
Definition console_key.hpp:134
@ g
The G key.
Definition console_key.hpp:100
The xtd::drawing::drawing_2d namespace provides advanced two-dimensional and vector graphics function...
Definition compositing_mode.hpp:12
The xtd::drawing namespace provides access to GDI+ basic graphics functionality. More advanced functi...
Definition actions_system_images.hpp:10
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
constexpr const_pointer data() const noexcept
Gets direct access to the underlying contiguous storage.
Definition read_only_span.hpp:201
Represents an ordered pair of floating-point x- and y-coordinates that defines a point in a two-dimen...
Definition point_f.hpp:35
Represents an ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional ...
Definition point.hpp:54
Stores a set of four floating-point numbers that represent the location and size of a rectangle....
Definition rectangle_f.hpp:34
Stores a set of four integers that represent the location and size of a rectangle.
Definition rectangle.hpp:44
Stores an ordered pair of integers, which specify a height and width.
Definition size.hpp:31