xtd 0.2.0
Loading...
Searching...
No Matches
region.h
Go to the documentation of this file.
1
4#pragma once
5#include "../drawing_export.h"
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
86 using object::equals;
87 bool equals(const region& value) const noexcept override;
88
91 void exclude(const xtd::drawing::drawing_2d::graphics_path& path) noexcept;
94 void exclude(const xtd::drawing::rectangle& rect) noexcept;
96 void exclude(const xtd::drawing::rectangle_f& rect) noexcept;
99 void exclude(const xtd::drawing::region& region) noexcept;
100
105 xtd::drawing::rectangle_f get_bounds() const noexcept;
110 xtd::drawing::rectangle_f get_bounds(const xtd::drawing::graphics& g) const noexcept;
111
116 intptr get_hrgn(const xtd::drawing::graphics& g) const noexcept;
117
120 void intersect(const xtd::drawing::drawing_2d::graphics_path& path) noexcept;
123 void intersect(const xtd::drawing::rectangle& rect) noexcept;
126 void intersect(const xtd::drawing::rectangle_f& rect) noexcept;
129 void intersect(const xtd::drawing::region& region) noexcept;
130
134 bool is_empty() const noexcept;
139 bool is_empty(const xtd::drawing::graphics& g) const noexcept;
140
144 bool is_infinite() const noexcept;
149 bool is_infinite(const xtd::drawing::graphics& g) const noexcept;
150
156 bool is_visible(const xtd::drawing::rectangle_f& rect, const xtd::drawing::graphics& g) const noexcept;
165 bool is_visible(float x, float y, float width, float height, const xtd::drawing::graphics& g) const noexcept;
171 bool is_visible(const xtd::drawing::rectangle& rect, const xtd::drawing::graphics& g) const noexcept;
180 bool is_visible(int32 x, int32 y, int32 width, int32 height, const xtd::drawing::graphics& g) const noexcept;
184 bool is_visible(const xtd::drawing::rectangle_f& rect) const noexcept;
191 bool is_visible(float x, float y, float width, float height) const noexcept;
195 bool is_visible(const xtd::drawing::rectangle& rect) const noexcept;
202 bool is_visible(int32 x, int32 y, int32 width, int32 height) const noexcept;
208 bool is_visible(xtd::drawing::point_f pt, const xtd::drawing::graphics& g) const noexcept;
215 bool is_visible(float x, float y, const xtd::drawing::graphics& g) const noexcept;
221 bool is_visible(xtd::drawing::point pt, const xtd::drawing::graphics& g) const noexcept;
228 bool is_visible(int32 x, int32 y, const xtd::drawing::graphics& g) const noexcept;
232 bool is_visible(xtd::drawing::point_f pt) const noexcept;
237 bool is_visible(float x, float y) const noexcept;
241 bool is_visible(xtd::drawing::point pt) const noexcept;
246 bool is_visible(int32 x, int32 y) const noexcept;
247
249 void make_empty();
250
252 void make_infinite() noexcept;
253
256 void make_union(const xtd::drawing::drawing_2d::graphics_path& path) noexcept;
259 void make_union(const xtd::drawing::rectangle& rect) noexcept;
262 void make_union(const xtd::drawing::rectangle_f& rect) noexcept;
265 void make_union(const xtd::drawing::region& region) noexcept;
266
269 void make_xor(const xtd::drawing::drawing_2d::graphics_path& path) noexcept;
272 void make_xor(const xtd::drawing::rectangle& rect) noexcept;
275 void make_xor(const xtd::drawing::rectangle_f& rect) noexcept;
278 void make_xor(const xtd::drawing::region& region) noexcept;
279
282 void release_hrgn(intptr region_handle);
283
287 void translate(int32 dx, int32 dy) noexcept;
291 void translate(float dx, float dy) noexcept;
293
295
301 static xtd::drawing::region from_hrgn(intptr hrgn);
303
304 private:
305 xtd::sptr<data> data_;
306 };
307 }
308}
Defines an object used to draw lines and curves. This class cannot be inherited.
Definition graphics_path.h:35
Defines an object used to draw lines and curves. This class cannot be inherited.
Definition graphics.h:70
Represents an ordered pair of floating-point x- and y-coordinates that defines a point in a two-dimen...
Definition point_f.h:35
Represents an ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional ...
Definition point.h:54
Stores a set of four floating-point numbers that represent the location and size of a rectangle....
Definition rectangle_f.h:34
Stores a set of four integers that represent the location and size of a rectangle.
Definition rectangle.h:44
Describes the interior of a graphics shape composed of rectangles and paths. This class cannot be inh...
Definition region.h:32
region()
Initializes a new xtd::drawing::region.
region(const xtd::drawing::rectangle_f &rect)
Initializes a new xtd::drawing::region from the specified xtd::drawing::rectangle_f structure.
region(const xtd::drawing::drawing_2d::graphics_path &path)
Initializes a new xtd::drawing::region with the specified xtd::drawing::graphics_path.
intptr handle() const noexcept
Gets the handle of the region.
region(const xtd::drawing::rectangle &rect)
Initializes a new xtd::drawing::region from the specified xtd::drawing::rectangle structure.
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.h:22
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
int32_t int32
Represents a 32-bit signed integer.
Definition int32.h:23
intmax_t intptr
Represent a pointer or a handle.
Definition intptr.h:23
std::shared_ptr< type_t > sptr
The xtd::sptr object is a shared pointer.
Definition sptr.h:25
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10
Contains xtd::drawing::drawing_2d::graphics_path class.