xtd 0.2.0
graphics_path.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "../../drawing_export.hpp"
6#include "../font_family.hpp"
7#include "../font_style.hpp"
8#include "../rectangle.hpp"
9#include "../rectangle_f.hpp"
10#include "../string_format.hpp"
11#include "fill_mode.hpp"
12#include <xtd/array>
13#include <xtd/object>
14#include <xtd/string>
15
17namespace xtd {
19 namespace drawing {
21 namespace drawing_2d {
33 class drawing_export_ graphics_path final : public xtd::object, xtd::iequatable<graphics_path> {
34 struct data;
35
36 public:
38
46
52
54
58 intptr handle() const noexcept;
59
60
63 xtd::drawing::drawing_2d::fill_mode fill_mode() const noexcept;
66 graphics_path& fill_mode(xtd::drawing::drawing_2d::fill_mode value) noexcept;
68
70
78 void add_arc(const xtd::drawing::rectangle& rect, float start_angle, float sweep_angle);
85 void add_arc(const xtd::drawing::rectangle_f& rect, float start_angle, float sweep_angle);
95 void add_arc(int32 x, int32 y, int32 width, int32 height, float start_angle, float sweep_angle);
105 void add_arc(float x, float y, float width, float height, float start_angle, float sweep_angle);
106
114 void add_bezier(const xtd::drawing::point& pt1, const xtd::drawing::point& pt2, const xtd::drawing::point& pt3, const xtd::drawing::point& pt4);
122 void add_bezier(const xtd::drawing::point_f& pt1, const xtd::drawing::point_f& pt2, const xtd::drawing::point_f& pt3, const xtd::drawing::point_f& pt4);
134 void add_bezier(int32 x1, int32 y1, int32 x2, int32 y2, int32 x3, int32 y3, int32 x4, int32 y4);
146 void add_bezier(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4);
147
152 void add_beziers(const xtd::array<xtd::drawing::point>& points);
157 void add_beziers(const xtd::array<xtd::drawing::point_f>& points);
158
162 void add_closed_curve(const xtd::array<xtd::drawing::point>& points);
166 void add_closed_curve(const xtd::array<xtd::drawing::point_f>& points);
171 void add_closed_curve(const xtd::array<xtd::drawing::point>& points, float tension);
176 void add_closed_curve(const xtd::array<xtd::drawing::point_f>& points, float tension);
177
182 void add_curve(const xtd::array<xtd::drawing::point>& points);
186 void add_curve(const xtd::array<xtd::drawing::point_f>& points);
191 void add_curve(const xtd::array<xtd::drawing::point>& points, float tension);
196 void add_curve(const xtd::array<xtd::drawing::point_f>& points, float tension);
204 void add_curve(const xtd::array<xtd::drawing::point>& points, size_t offset, size_t number_of_segments, float tension);
212 void add_curve(const xtd::array<xtd::drawing::point_f>& points, size_t offset, size_t number_of_segments, float tension);
213
216 void add_ellipse(const xtd::drawing::rectangle& rect);
219 void add_ellipse(const xtd::drawing::rectangle_f& rect);
225 void add_ellipse(int32 x, int32 y, int32 width, int32 height);
231 void add_ellipse(float x, float y, float width, float height);
232
237 void add_line(const xtd::drawing::point& pt1, const xtd::drawing::point& pt2);
242 void add_line(const xtd::drawing::point_f& pt1, const xtd::drawing::point_f& pt2);
249 void add_line(int32 x1, int32 y1, int32 x2, int32 y2);
256 void add_line(float x1, float y1, float x2, float y2);
257
261 void add_lines(const xtd::array<xtd::drawing::point>& points);
265 void add_lines(const xtd::array<xtd::drawing::point_f>& points);
266
270 void add_path(const graphics_path& adding_path, bool connect);
271
277 void add_pie(const xtd::drawing::rectangle& rect, float start_angle, float sweep_angle);
283 void add_pie(const xtd::drawing::rectangle_f& rect, float start_angle, float sweep_angle);
292 void add_pie(int32 x, int32 y, int32 width, int32 height, float start_angle, float sweep_angle);
301 void add_pie(float x, float y, float width, float height, float start_angle, float sweep_angle);
302
306 void add_polygon(const xtd::array<xtd::drawing::point>& points);
310 void add_polygon(const xtd::array<xtd::drawing::point_f>& points);
311
314 void add_rectangle(const xtd::drawing::rectangle& rect);
317 void add_rectangle(const xtd::drawing::rectangle_f& rect);
323 void add_rectangle(int32 x, int32 y, int32 width, int32 height);
329 void add_rectangle(float x, float y, float width, float height);
330
333 void add_rectangles(const xtd::array<xtd::drawing::rectangle>& rects);
336 void add_rectangles(const xtd::array<xtd::drawing::rectangle_f>& rects);
337
341 void add_rounded_rectangle(const xtd::drawing::rectangle& rect, float radius);
345 void add_rounded_rectangle(const xtd::drawing::rectangle_f& rect, float radius);
352 void add_rounded_rectangle(int32 x, int32 y, int32 width, int32 height, float radius);
359 void add_rounded_rectangle(float x, float y, float width, float height, float radius);
360
367 void add_string(const xtd::string& s, const xtd::drawing::font_family& family, xtd::drawing::font_style style, float em_size, const xtd::drawing::point& origin, const xtd::drawing::string_format& format);
374 void add_string(const xtd::string& s, const xtd::drawing::font_family& family, xtd::drawing::font_style style, float em_size, const xtd::drawing::point_f& origin, const xtd::drawing::string_format& format);
381 void add_string(const xtd::string& s, const xtd::drawing::font_family& family, xtd::drawing::font_style style, float em_size, const xtd::drawing::rectangle& layout_rect, const xtd::drawing::string_format& format);
388 void add_string(const xtd::string& s, const xtd::drawing::font_family& family, xtd::drawing::font_style style, float em_size, const xtd::drawing::rectangle_f& layout_rect, const xtd::drawing::string_format& format);
389
391 void close_all_figures();
392
394 void close_figure();
395
399 bool equals(const object& obj) const noexcept override;
403 bool equals(const graphics_path& other) const noexcept override;
404
406 void flatten();
407
411 xtd::drawing::rectangle_f get_bounds() const;
412
415 xtd::drawing::point_f get_lat_point() const;
416
420 bool is_vsible(const xtd::drawing::point& point) const;
424 bool is_vsible(const xtd::drawing::point_f& point) const;
429 bool is_vsible(int32 x, int32 y) const;
434 bool is_vsible(float x, float y) const;
435
437 void reset();
438
440 void reverse();
441
445 void start_figure();
446
447 xtd::string to_string() const noexcept override;
449
450 private:
451 void recreate_handle();
452
453 xtd::sptr<data> data_;
454 };
455 }
456 }
457}
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition array.hpp:61
Defines an object used to draw lines and curves. This class cannot be inherited.
Definition graphics_path.hpp:33
graphics_path()
Initializes a new instance of the xtd::drawing::drawing_2d::graphics_path class with a xtd::drawing::...
intptr handle() const noexcept
Gets the handle of the graphics path.
graphics_path(xtd::drawing::drawing_2d::fill_mode mode)
Initializes a new instance of the xtd::drawing::drawing_2d::graphics_path class with the specified xt...
Defines a group of type faces having a similar basic design and certain variations in styles....
Definition font_family.hpp:33
Encapsulates text layout information (such as alignment, orientation and tab stops) display manipulat...
Definition string_format.hpp:30
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:43
The xtd::shared_ptr_object is a shared pointer as std::shared_ptr.
Definition shared_ptr_object.hpp:30
Contains xtd::drawing::drawing_2d::fill_mode enum class.
font_style
Specifies style information applied to text. This enumeration has a flags attribute that allows a bit...
Definition font_style.hpp:17
#define drawing_export_
Define shared library export.
Definition drawing_export.hpp:13
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
fill_mode
Specifies how the interior of a closed path is filled.
Definition fill_mode.hpp:23
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10
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