xtd 0.2.0
graphics_path.hpp
Go to the documentation of this file.
1
4#pragma once
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
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);
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);
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
392
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
412
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
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
xtd::string to_string() const noexcept override
Returns a xtd::string that represents the current object.
void add_lines(const xtd::array< xtd::drawing::point > &points)
Appends a series of connected line segments to the end of this xtd::drawing::drawing_2d::graphics_pat...
void add_arc(const xtd::drawing::rectangle &rect, float start_angle, float sweep_angle)
Appends an elliptical arc to the current figure.
void add_ellipse(const xtd::drawing::rectangle &rect)
Adds an ellipse to the current path.
void add_pie(const xtd::drawing::rectangle &rect, float start_angle, float sweep_angle)
Adds the outline of a pie shape to this path.
graphics_path()
Initializes a new instance of the xtd::drawing::drawing_2d::graphics_path class with a xtd::drawing::...
void close_all_figures()
Closes all open figures in this path and starts a new figure. It closes each open figure by connectin...
void add_beziers(const xtd::array< xtd::drawing::point > &points)
Adds a sequence of connected cubic Bézier curves to the current figure.
xtd::drawing::drawing_2d::fill_mode fill_mode() const noexcept
Gets a xtd::drawing::drawing_2d::fill_mode enumeration that determines how the interiors of shapes in...
void add_closed_curve(const xtd::array< xtd::drawing::point > &points)
Adds a closed curve to this path. A cardinal spline curve is used because the curve travels through e...
intptr handle() const noexcept
Gets the handle of the graphics path.
void add_bezier(const xtd::drawing::point &pt1, const xtd::drawing::point &pt2, const xtd::drawing::point &pt3, const xtd::drawing::point &pt4)
Adds a cubic Bézier curve to the current figure.
void reverse()
Reverses the order of points in the xtd::drawing::drawing_2d::graphics_path::path_points array of thi...
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...
bool equals(const object &obj) const noexcept override
Determines whether the specified object is equal to the current object.
xtd::drawing::rectangle_f get_bounds() const
Returns a rectangle that bounds this xtd::drawing::drawing_2d::graphics_path.
void reset()
Empties the xtd::drawing::drawing_2d::graphics_path::path_points and xtd::drawing::drawing_2d::graphi...
void add_line(const xtd::drawing::point &pt1, const xtd::drawing::point &pt2)
Appends a line segment to this xtd::drawing::drawing_2d::graphics_path.
void close_figure()
Closes the current figure and starts a new figure. If the current figure contains a sequence of conne...
void add_curve(const xtd::array< xtd::drawing::point > &points)
Adds a spline curve to the current figure.
void flatten()
Converts each curve in this path into a sequence of connected line segments.
void start_figure()
Starts a new figure without closing the current figure. All subsequent points added to the path are a...
void add_rectangles(const xtd::array< xtd::drawing::rectangle > &rects)
Adds a series of rectangles to this path.
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)
Adds a text string to this path.
xtd::drawing::point_f get_lat_point() const
Gets the last point of this xtd::drawing::drawing_2d::graphics_path.
void add_path(const graphics_path &adding_path, bool connect)
Appends the specified xtd::drawing::drawing_2d::graphics_path to this path.
void add_polygon(const xtd::array< xtd::drawing::point > &points)
Adds a polygon to this path.
void add_rounded_rectangle(const xtd::drawing::rectangle &rect, float radius)
Adds a rounded rectangle to this path.
void add_rectangle(const xtd::drawing::rectangle &rect)
Adds a rectangle to this path.
bool is_vsible(const xtd::drawing::point &point) const
Indicates whether the specified point is contained within this xtd::drawing::drawing_2d::graphics_pat...
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:44
Contains drawing_export_ keyword.
Contains xtd::drawing::drawing_2d::fill_mode enum class.
Contains xtd::drawing::font_family class.
Contains xtd::drawing::font_style 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
xtd::string format(const xtd::string &fmt, args_t &&... args)
Writes the text representation of the specified arguments list, to string using the specified format ...
Definition format.hpp:20
#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
@ other
The operating system is other.
Definition platform_id.hpp:58
@ s
The S key.
Definition console_key.hpp:124
@ y
The Y key.
Definition console_key.hpp:136
@ x
The X key.
Definition console_key.hpp:134
fill_mode
Specifies how the interior of a closed path is filled.
Definition fill_mode.hpp:23
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
Contains xtd::drawing::rectangle class.
Contains xtd::drawing::rectangle_f class.
Contains xtd::drawing::string_format class.
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