xtd 1.0.0
Loading...
Searching...
No Matches
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 [[nodiscard]] auto handle() const noexcept -> xtd::intptr;
59
60
63 [[nodiscard]] auto fill_mode() const noexcept -> xtd::drawing::drawing_2d::fill_mode;
68
70
78 auto add_arc(const xtd::drawing::rectangle& rect, float start_angle, float sweep_angle) -> void;
85 auto add_arc(const xtd::drawing::rectangle_f& rect, float start_angle, float sweep_angle) -> void;
95 auto add_arc(xtd::int32 x, xtd::int32 y, xtd::int32 width, xtd::int32 height, float start_angle, float sweep_angle) -> void;
105 auto add_arc(float x, float y, float width, float height, float start_angle, float sweep_angle) -> void;
106
114 auto add_bezier(const xtd::drawing::point& pt1, const xtd::drawing::point& pt2, const xtd::drawing::point& pt3, const xtd::drawing::point& pt4) -> void;
122 auto 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) -> void;
134 auto add_bezier(xtd::int32 x1, xtd::int32 y1, xtd::int32 x2, xtd::int32 y2, xtd::int32 x3, xtd::int32 y3, xtd::int32 x4, xtd::int32 y4) -> void;
146 auto add_bezier(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4) -> void;
147
152 auto add_beziers(const xtd::array<xtd::drawing::point>& points) -> void;
157 auto add_beziers(const xtd::array<xtd::drawing::point_f>& points) -> void;
158
162 auto add_closed_curve(const xtd::array<xtd::drawing::point>& points) -> void;
166 auto add_closed_curve(const xtd::array<xtd::drawing::point_f>& points) -> void;
171 auto add_closed_curve(const xtd::array<xtd::drawing::point>& points, float tension) -> void;
176 auto add_closed_curve(const xtd::array<xtd::drawing::point_f>& points, float tension) -> void;
177
182 auto add_curve(const xtd::array<xtd::drawing::point>& points) -> void;
186 auto add_curve(const xtd::array<xtd::drawing::point_f>& points) -> void;
191 auto add_curve(const xtd::array<xtd::drawing::point>& points, float tension) -> void;
196 auto add_curve(const xtd::array<xtd::drawing::point_f>& points, float tension) -> void;
204 auto add_curve(const xtd::array<xtd::drawing::point>& points, xtd::usize offset, xtd::usize number_of_segments, float tension) -> void;
212 auto add_curve(const xtd::array<xtd::drawing::point_f>& points, xtd::usize offset, xtd::usize number_of_segments, float tension) -> void;
213
216 auto add_ellipse(const xtd::drawing::rectangle& rect) -> void;
219 auto add_ellipse(const xtd::drawing::rectangle_f& rect) -> void;
225 auto add_ellipse(xtd::int32 x, xtd::int32 y, xtd::int32 width, xtd::int32 height) -> void;
231 auto add_ellipse(float x, float y, float width, float height) -> void;
232
237 auto add_line(const xtd::drawing::point& pt1, const xtd::drawing::point& pt2) -> void;
242 auto add_line(const xtd::drawing::point_f& pt1, const xtd::drawing::point_f& pt2) -> void;
249 auto add_line(xtd::int32 x1, xtd::int32 y1, xtd::int32 x2, xtd::int32 y2) -> void;
256 auto add_line(float x1, float y1, float x2, float y2) -> void;
257
261 auto add_lines(const xtd::array<xtd::drawing::point>& points) -> void;
265 auto add_lines(const xtd::array<xtd::drawing::point_f>& points) -> void;
266
270 auto add_path(const graphics_path& adding_path, bool connect) -> void;
271
277 auto add_pie(const xtd::drawing::rectangle& rect, float start_angle, float sweep_angle) -> void;
283 auto add_pie(const xtd::drawing::rectangle_f& rect, float start_angle, float sweep_angle) -> void;
292 auto add_pie(xtd::int32 x, xtd::int32 y, xtd::int32 width, xtd::int32 height, float start_angle, float sweep_angle) -> void;
301 auto add_pie(float x, float y, float width, float height, float start_angle, float sweep_angle) -> void;
302
306 auto add_polygon(const xtd::array<xtd::drawing::point>& points) -> void;
310 auto add_polygon(const xtd::array<xtd::drawing::point_f>& points) -> void;
311
314 auto add_rectangle(const xtd::drawing::rectangle& rect) -> void;
317 auto add_rectangle(const xtd::drawing::rectangle_f& rect) -> void;
323 auto add_rectangle(xtd::int32 x, xtd::int32 y, xtd::int32 width, xtd::int32 height) -> void;
329 auto add_rectangle(float x, float y, float width, float height) -> void;
330
333 auto add_rectangles(const xtd::array<xtd::drawing::rectangle>& rects) -> void;
336 auto add_rectangles(const xtd::array<xtd::drawing::rectangle_f>& rects) -> void;
337
341 auto add_rounded_rectangle(const xtd::drawing::rectangle& rect, float radius) -> void;
345 auto add_rounded_rectangle(const xtd::drawing::rectangle_f& rect, float radius) -> void;
352 auto add_rounded_rectangle(xtd::int32 x, xtd::int32 y, xtd::int32 width, xtd::int32 height, float radius) -> void;
359 auto add_rounded_rectangle(float x, float y, float width, float height, float radius) -> void;
360
367 auto 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) -> void;
374 auto 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) -> void;
381 auto 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) -> void;
388 auto 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) -> void;
389
391 auto close_all_figures() -> void;
392
394 auto close_figure() -> void;
395
399 bool equals(const object& obj) const noexcept override;
403 bool equals(const graphics_path& other) const noexcept override;
404
406 auto flatten() -> void;
407
411 [[nodiscard]] auto get_bounds() const -> xtd::drawing::rectangle_f;
412
415 [[nodiscard]] auto get_lat_point() const -> xtd::drawing::point_f;
416
420 [[nodiscard]] auto is_vsible(const xtd::drawing::point& point) const -> bool;
424 [[nodiscard]] auto is_vsible(const xtd::drawing::point_f& point) const -> bool;
429 [[nodiscard]] auto is_vsible(xtd::int32 x, xtd::int32 y) const -> bool;
434 [[nodiscard]] auto is_vsible(float x, float y) const -> bool;
435
437 auto reset() -> void;
438
440 auto reverse() -> void;
441
445 auto start_figure() -> void;
446
447 [[nodiscard]] auto to_string() const noexcept -> xtd::string override;
449
450 private:
451 auto recreate_handle() -> void;
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:64
Defines an object used to draw lines and curves. This class cannot be inherited.
Definition graphics_path.hpp:33
auto close_figure() -> void
Closes the current figure and starts a new figure. If the current figure contains a sequence of conne...
auto add_lines(const xtd::array< xtd::drawing::point > &points) -> void
Appends a series of connected line segments to the end of this xtd::drawing::drawing_2d::graphics_pat...
auto get_bounds() const -> xtd::drawing::rectangle_f
Returns a rectangle that bounds this xtd::drawing::drawing_2d::graphics_path.
auto 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) -> void
Adds a text string to this path.
auto reverse() -> void
Reverses the order of points in the xtd::drawing::drawing_2d::graphics_path::path_points array of thi...
auto add_curve(const xtd::array< xtd::drawing::point > &points) -> void
Adds a spline curve to the current figure.
auto add_rounded_rectangle(const xtd::drawing::rectangle &rect, float radius) -> void
Adds a rounded rectangle to this path.
auto start_figure() -> void
Starts a new figure without closing the current figure. All subsequent points added to the path are a...
auto fill_mode() const noexcept -> xtd::drawing::drawing_2d::fill_mode
Gets a xtd::drawing::drawing_2d::fill_mode enumeration that determines how the interiors of shapes in...
auto flatten() -> void
Converts each curve in this path into a sequence of connected line segments.
graphics_path()
Initializes a new instance of the xtd::drawing::drawing_2d::graphics_path class with a xtd::drawing::...
auto is_vsible(const xtd::drawing::point &point) const -> bool
Indicates whether the specified point is contained within this xtd::drawing::drawing_2d::graphics_pat...
auto add_beziers(const xtd::array< xtd::drawing::point > &points) -> void
Adds a sequence of connected cubic Bézier curves to the current figure.
auto add_pie(const xtd::drawing::rectangle &rect, float start_angle, float sweep_angle) -> void
Adds the outline of a pie shape to this path.
auto add_closed_curve(const xtd::array< xtd::drawing::point > &points) -> void
Adds a closed curve to this path. A cardinal spline curve is used because the curve travels through e...
auto add_arc(const xtd::drawing::rectangle &rect, float start_angle, float sweep_angle) -> void
Appends an elliptical arc to the current figure.
auto handle() const noexcept -> xtd::intptr
Gets the handle of the graphics path.
auto add_line(const xtd::drawing::point &pt1, const xtd::drawing::point &pt2) -> void
Appends a line segment to this xtd::drawing::drawing_2d::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...
bool equals(const object &obj) const noexcept override
Determines whether the specified object is equal to the current object.
auto reset() -> void
Empties the xtd::drawing::drawing_2d::graphics_path::path_points and xtd::drawing::drawing_2d::graphi...
auto add_ellipse(const xtd::drawing::rectangle &rect) -> void
Adds an ellipse to the current path.
auto add_polygon(const xtd::array< xtd::drawing::point > &points) -> void
Adds a polygon to this path.
auto add_path(const graphics_path &adding_path, bool connect) -> void
Appends the specified xtd::drawing::drawing_2d::graphics_path to this path.
auto add_rectangles(const xtd::array< xtd::drawing::rectangle > &rects) -> void
Adds a series of rectangles to this path.
auto get_lat_point() const -> xtd::drawing::point_f
Gets the last point of this xtd::drawing::drawing_2d::graphics_path.
auto close_all_figures() -> void
Closes all open figures in this path and starts a new figure. It closes each open figure by connectin...
auto add_bezier(const xtd::drawing::point &pt1, const xtd::drawing::point &pt2, const xtd::drawing::point &pt3, const xtd::drawing::point &pt4) -> void
Adds a cubic Bézier curve to the current figure.
auto add_rectangle(const xtd::drawing::rectangle &rect) -> void
Adds a rectangle to this path.
auto to_string() const noexcept -> xtd::string override
Returns a xtd::string that represents the current object.
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:23
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:45
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
auto format(const xtd::string &fmt, args_t &&... args) -> xtd::string
Writes the text representation of the specified arguments list, to string using the specified format ...
Definition format.hpp:21
#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
std::intmax_t intptr
Represent a pointer or a handle.
Definition intptr.hpp:23
std::int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:25
std::size_t usize
Represents an unsigned size of any object in bytes.
Definition usize.hpp:22
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 auto data() const noexcept -> const_pointer
Gets direct access to the underlying contiguous storage.
Definition read_only_span.hpp:197
Contains xtd::drawing::rectangle struct.
Contains xtd::drawing::rectangle_f struct.
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