xtd 1.0.0
Loading...
Searching...
No Matches
graphics.hpp
Go to the documentation of this file.
1
4#pragma once
12#include "drawing_2d/matrix.hpp"
17#include "brush.hpp"
19#include "solid_brush.hpp"
20#include "color.hpp"
21#include "font.hpp"
22#include "graphics_unit.hpp"
23#include "pen.hpp"
24#include "point.hpp"
25#include "point_f.hpp"
26#include "rectangle.hpp"
27#include "rectangle_f.hpp"
28#include "region.hpp"
29#include "size.hpp"
30#include "string_format.hpp"
31#include "size_f.hpp"
32#include <xtd/object>
33#include <xtd/string>
34
35
37namespace xtd {
38 namespace forms {
39 class control;
40 class control_paint;
41 class paint_event_args;
42 class region;
43 class screen;
44 }
45}
47
49namespace xtd {
51 namespace drawing {
53 class icon;
54 class image;
67 class drawing_export_ graphics : public xtd::object {
68 struct data;
69
70 public:
72 graphics(const graphics& value);
73 graphics& operator =(const graphics& value);
74 ~graphics();
76
78
83 [[nodiscard]] auto clip() const noexcept -> xtd::drawing::region;
88 auto clip(const xtd::drawing::region value) -> graphics&;
89
94 [[nodiscard]] auto clip_bounds() const noexcept -> xtd::drawing::rectangle_f;
95
100 [[nodiscard]] auto compositing_mode() const noexcept -> xtd::drawing::drawing_2d::compositing_mode;
107
111 [[nodiscard]] auto compositing_quality() const noexcept -> xtd::drawing::drawing_2d::compositing_quality;
117
120 [[nodiscard]] auto dpi_x() const noexcept -> float;
121
124 [[nodiscard]] auto dpi_y() const noexcept -> float;
125
128 [[nodiscard]] auto handle() const noexcept -> xtd::intptr;
129
133 [[nodiscard]] auto interpolation_mode() const noexcept -> xtd::drawing::drawing_2d::interpolation_mode;
138 auto interpolation_mode(xtd::drawing::drawing_2d::interpolation_mode value) noexcept -> graphics&;
139
142 [[nodiscard]] auto page_scale() const noexcept -> float;
146 auto page_scale(float value) noexcept -> graphics&;
147
151 [[nodiscard]] auto page_unit() const noexcept -> xtd::drawing::graphics_unit;
157 auto page_unit(xtd::drawing::graphics_unit value) -> graphics&;
158
162 [[nodiscard]] auto pixel_offset_mode() const noexcept -> xtd::drawing::drawing_2d::pixel_offset_mode;
167 auto pixel_offset_mode(xtd::drawing::drawing_2d::pixel_offset_mode value) noexcept -> graphics&;
168
172 [[nodiscard]] auto smoothing_mode() const noexcept -> xtd::drawing::drawing_2d::smoothing_mode;
177 auto smoothing_mode(xtd::drawing::drawing_2d::smoothing_mode value) noexcept -> graphics&;
178
182 [[nodiscard]] auto text_contrast() const noexcept -> xtd::int32;
187 auto text_contrast(xtd::int32 value) noexcept -> graphics&;
188
193 [[nodiscard]] auto text_rendering_hint() const noexcept -> xtd::drawing::text::text_rendering_hint;
200
205 [[nodiscard]] auto transform() const noexcept -> xtd::drawing::drawing_2d::matrix;
211 auto transform(const xtd::drawing::drawing_2d::matrix& value) noexcept -> graphics&;
212
217 [[nodiscard]] auto visible_clip_bounds() const noexcept -> xtd::drawing::rectangle_f;
219
221
225 auto clear(const xtd::drawing::color& color) -> void;
226
233 auto copy_from_graphics(const graphics& source, const xtd::drawing::point& upper_left_source, const xtd::drawing::point& upper_left_destination, const xtd::drawing::size& block_region_size) -> void;
241 auto copy_from_graphics(const graphics& source, const xtd::drawing::point& upper_left_source, const xtd::drawing::point& upper_left_destination, const xtd::drawing::size& block_region_size, xtd::drawing::copy_pixel_operation copy_pixel_operation) -> void;
250 auto copy_from_graphics(const graphics& source, xtd::int32 source_x, xtd::int32 source_y, xtd::int32 destination_x, xtd::int32 destination_y, const xtd::drawing::size& block_region_size) -> void;
260 auto copy_from_graphics(const graphics& source, xtd::int32 source_x, xtd::int32 source_y, xtd::int32 destination_x, xtd::int32 destination_y, const xtd::drawing::size& block_region_size, xtd::drawing::copy_pixel_operation copy_pixel_operation) -> void;
261
267 auto copy_from_screen(const xtd::drawing::point& upper_left_source, const xtd::drawing::point& upper_left_destination, const xtd::drawing::size& block_region_size) -> void;
274 auto copy_from_screen(const xtd::drawing::point& upper_left_source, const xtd::drawing::point& upper_left_destination, const xtd::drawing::size& block_region_size, xtd::drawing::copy_pixel_operation copy_pixel_operation) -> void;
282 auto copy_from_screen(xtd::int32 source_x, xtd::int32 source_y, xtd::int32 destination_x, xtd::int32 destination_y, const xtd::drawing::size& block_region_size) -> void;
291 auto copy_from_screen(xtd::int32 source_x, xtd::int32 source_y, xtd::int32 destination_x, xtd::int32 destination_y, const xtd::drawing::size& block_region_size, xtd::drawing::copy_pixel_operation copy_pixel_operation) -> void;
292
299 auto draw_arc(const xtd::drawing::pen& pen, const xtd::drawing::rectangle& rect, float start_angle, float sweep_angle) -> void;
306 auto draw_arc(const xtd::drawing::pen& pen, const xtd::drawing::rectangle_f& rect, float start_angle, float sweep_angle) -> void;
316 auto draw_arc(const xtd::drawing::pen& pen, xtd::int32 x, xtd::int32 y, xtd::int32 width, xtd::int32 height, xtd::int32 start_angle, xtd::int32 sweep_angle) -> void;
326 auto draw_arc(const xtd::drawing::pen& pen, float x, float y, float width, float height, float start_angle, float sweep_angle) -> void;
327
335 auto draw_bezier(const xtd::drawing::pen& pen, const xtd::drawing::point& pt1, const xtd::drawing::point& pt2, const xtd::drawing::point& pt3, const xtd::drawing::point& pt4) -> void;
343 auto draw_bezier(const xtd::drawing::pen& pen, 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;
355 auto draw_bezier(const pen& pen, 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;
367 auto draw_bezier(const pen& pen, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4) -> void;
368
373 auto draw_beziers(const pen& pen, const xtd::array<xtd::drawing::point>& points) -> void;
378 auto draw_beziers(const pen& pen, const xtd::array<xtd::drawing::point_f>& points) -> void;
379
386 auto draw_closed_curve(const pen& pen, const xtd::array<xtd::drawing::point>& points) -> void;
393 auto draw_closed_curve(const pen& pen, const xtd::array<xtd::drawing::point_f>& points) -> void;
401 auto draw_closed_curve(const pen& pen, const xtd::array<xtd::drawing::point>& points, float tension) -> void;
409 auto draw_closed_curve(const pen& pen, const xtd::array<xtd::drawing::point_f>& points, float tension) -> void;
410
417 auto draw_curve(const pen& pen, const xtd::array<xtd::drawing::point>& points) -> void;
424 auto draw_curve(const pen& pen, const xtd::array<xtd::drawing::point_f>& points) -> void;
432 auto draw_curve(const pen& pen, const xtd::array<xtd::drawing::point>& points, float tension) -> void;
440 auto draw_curve(const pen& pen, const xtd::array<xtd::drawing::point_f>& points, float tension) -> void;
452 auto draw_curve(const pen& pen, const xtd::array<xtd::drawing::point>& points, xtd::usize offset, xtd::usize number_of_segments) -> void;
464 auto draw_curve(const pen& pen, const xtd::array<xtd::drawing::point_f>& points, xtd::usize offset, xtd::usize number_of_segments) -> void;
476 auto draw_curve(const pen& pen, const xtd::array<xtd::drawing::point>& points, xtd::usize offset, xtd::usize number_of_segments, float tension) -> void;
488 auto draw_curve(const pen& pen, const xtd::array<xtd::drawing::point_f>& points, xtd::usize offset, xtd::usize number_of_segments, float tension) -> void;
489
494 auto draw_ellipse(const xtd::drawing::pen& pen, const xtd::drawing::rectangle& rect) -> void;
499 auto draw_ellipse(const xtd::drawing::pen& pen, const xtd::drawing::rectangle_f& rect) -> void;
507 auto draw_ellipse(const xtd::drawing::pen& pen, xtd::int32 x, xtd::int32 y, xtd::int32 width, xtd::int32 height) -> void;
515 auto draw_ellipse(const xtd::drawing::pen& pen, float x, float y, float width, float height) -> void;
516
521 auto draw_icon(const xtd::drawing::icon& icon, xtd::int32 x, xtd::int32 y) -> void;
525 auto draw_icon(const xtd::drawing::icon& icon, const xtd::drawing::rectangle& rect) -> void;
526
530 auto draw_icon_unstretched(const xtd::drawing::icon& icon, const xtd::drawing::rectangle& rect) -> void;
531
536 auto draw_image(const xtd::drawing::image& image, const xtd::drawing::rectangle& rect) -> void;
541 auto draw_image(const xtd::drawing::image& image, const xtd::drawing::rectangle_f& rect) -> void;
547 auto draw_image(const xtd::drawing::image& image, const xtd::drawing::point& point) -> void;
553 auto draw_image(const xtd::drawing::image& image, const xtd::drawing::point_f& point) -> void;
561 auto draw_image(const xtd::drawing::image& image, xtd::int32 x, xtd::int32 y, xtd::int32 width, xtd::int32 height) -> void;
569 auto draw_image(const xtd::drawing::image& image, float x, float y, float width, float height) -> void;
576 auto draw_image(const xtd::drawing::image& image, xtd::int32 x, xtd::int32 y) -> void;
583 auto draw_image(const xtd::drawing::image& image, float x, float y) -> void;
584
589 auto draw_image(const xtd::drawing::image& image, const xtd::drawing::rectangle& dest_rect, const xtd::drawing::rectangle& src_rect) -> void;
594 auto draw_image(const xtd::drawing::image& image, const xtd::drawing::rectangle_f& dest_rect, const xtd::drawing::rectangle_f& src_rect) -> void;
600 auto draw_image(const xtd::drawing::image& image, const xtd::drawing::point& dest_point, const xtd::drawing::rectangle& src_rect) -> void;
606 auto draw_image(const xtd::drawing::image& image, const xtd::drawing::point_f& dest_point, const xtd::drawing::rectangle_f& src_rect) -> void;
611 auto draw_image(const xtd::drawing::image& image, const xtd::drawing::rectangle& dest_rect, xtd::int32 src_x, xtd::int32 src_y, xtd::int32 srd_width, xtd::int32 src_height) -> void;
616 auto draw_image(const xtd::drawing::image& image, const xtd::drawing::rectangle_f& dest_rect, float src_x, float src_y, float srd_width, float src_height) -> void;
622 auto draw_image(const xtd::drawing::image& image, const xtd::drawing::point& dest_point, xtd::int32 src_x, xtd::int32 src_y, xtd::int32 srd_width, xtd::int32 src_height) -> void;
628 auto draw_image(const xtd::drawing::image& image, const xtd::drawing::point_f& dest_point, float src_x, float src_y, float srd_width, float src_height) -> void;
629
635 auto draw_image_unscaled(const xtd::drawing::image& image, const xtd::drawing::point& point) -> void;
642 auto draw_image_unscaled(const xtd::drawing::image& image, xtd::int32 x, xtd::int32 y) -> void;
648 auto draw_image_unscaled(const xtd::drawing::image& image, const xtd::drawing::rectangle& rect) -> void;
657 auto draw_image_unscaled(const xtd::drawing::image& image, xtd::int32 x, xtd::int32 y, xtd::int32 width, xtd::int32 height) -> void;
658
663
668 auto draw_line(const xtd::drawing::pen& pen, const xtd::drawing::point& pt1, const point& pt2) -> void;
673 auto draw_line(const xtd::drawing::pen& pen, const xtd::drawing::point_f& pt1, const point_f& pt2) -> void;
681 auto draw_line(const xtd::drawing::pen& pen, xtd::int32 x1, xtd::int32 y1, xtd::int32 x2, xtd::int32 y2) -> void;
689 auto draw_line(const xtd::drawing::pen& pen, float x1, float y1, float x2, float y2) -> void;
690
695 auto draw_lines(const xtd::drawing::pen& pen, const xtd::array<xtd::drawing::point>& points) -> void;
700 auto draw_lines(const xtd::drawing::pen& pen, const xtd::array<xtd::drawing::point_f>& points) -> void;
701
706 auto draw_path(const xtd::drawing::pen& pen, const xtd::drawing::drawing_2d::graphics_path& path) -> void;
707
715 auto draw_pie(const xtd::drawing::pen& pen, const xtd::drawing::rectangle& rect, float start_angle, float sweep_angle) -> void;
723 auto draw_pie(const xtd::drawing::pen& pen, const xtd::drawing::rectangle_f& rect, float start_angle, float sweep_angle) -> void;
734 auto draw_pie(const xtd::drawing::pen& pen, xtd::int32 x, xtd::int32 y, xtd::int32 width, xtd::int32 height, xtd::int32 start_angle, xtd::int32 sweep_angle) -> void;
745 auto draw_pie(const xtd::drawing::pen& pen, float x, float y, float width, float height, float start_angle, float sweep_angle) -> void;
746
751 auto draw_polygon(const xtd::drawing::pen& pen, const xtd::array<xtd::drawing::point>& points) -> void;
756 auto draw_polygon(const xtd::drawing::pen& pen, const xtd::array<xtd::drawing::point_f>& points) -> void;
757
761 auto draw_point(const xtd::drawing::pen& pen, const xtd::drawing::point& point) -> void;
765 auto draw_point(const xtd::drawing::pen& pen, const xtd::drawing::point_f& point) -> void;
770 auto draw_point(const xtd::drawing::pen& pen, xtd::int32 x, xtd::int32 y) -> void;
775 auto draw_point(const xtd::drawing::pen& pen, float x, float y) -> void;
776
780 auto draw_rectangle(const xtd::drawing::pen& pen, const xtd::drawing::rectangle& rect) -> void;
784 auto draw_rectangle(const xtd::drawing::pen& pen, const xtd::drawing::rectangle_f& rect) -> void;
791 auto draw_rectangle(const xtd::drawing::pen& pen, xtd::int32 x, xtd::int32 y, xtd::int32 width, xtd::int32 height) -> void;
798 auto draw_rectangle(const xtd::drawing::pen& pen, float x, float y, float width, float height) -> void;
799
803 auto draw_rectangles(const xtd::drawing::pen& pen, const xtd::array<xtd::drawing::rectangle>& rects) -> void;
807 auto draw_rectangles(const xtd::drawing::pen& pen, const xtd::array<xtd::drawing::rectangle_f>& rects) -> void;
808
815 auto draw_rotated_string(const xtd::string& s, const xtd::drawing::font& font, const xtd::drawing::brush& brush, const xtd::drawing::point_f& point, float angle) -> void;
823 auto draw_rotated_string(const xtd::string& s, const xtd::drawing::font& font, const xtd::drawing::brush& brush, float x, float y, float angle) -> void;
824
829 auto draw_rounded_rectangle(const xtd::drawing::pen& pen, const xtd::drawing::rectangle& rect, xtd::int32 radius) -> void;
834 auto draw_rounded_rectangle(const xtd::drawing::pen& pen, const xtd::drawing::rectangle_f& rect, float radius) -> void;
842 auto draw_rounded_rectangle(const xtd::drawing::pen& pen, xtd::int32 x, xtd::int32 y, xtd::int32 width, xtd::int32 height, xtd::int32 radius) -> void;
850 auto draw_rounded_rectangle(const xtd::drawing::pen& pen, float x, float y, float width, float height, float radius) -> void;
851
858 auto draw_string(const xtd::string& s, const xtd::drawing::font& font, const xtd::drawing::brush& brush, const xtd::drawing::rectangle_f& layout_rectangle) -> void;
866 auto draw_string(const xtd::string& s, const xtd::drawing::font& font, const xtd::drawing::brush& brush, const xtd::drawing::rectangle_f& layout_rectangle, const xtd::drawing::string_format& format) -> void;
872 auto draw_string(const xtd::string& s, const xtd::drawing::font& font, const xtd::drawing::brush& brush, const xtd::drawing::point_f& point) -> void;
879 auto draw_string(const xtd::string& s, const xtd::drawing::font& font, const xtd::drawing::brush& brush, const xtd::drawing::point_f& point, const xtd::drawing::string_format& format) -> void;
886 auto draw_string(const xtd::string& s, const xtd::drawing::font& font, const xtd::drawing::brush& brush, float x, float y) -> void;
894 auto draw_string(const xtd::string& s, const xtd::drawing::font& font, const xtd::drawing::brush& brush, float x, float y, const xtd::drawing::string_format& format) -> void;
895
899 auto exclude_clip(const xtd::drawing::region& region) -> void;
903 auto exclude_clip(const xtd::drawing::rectangle& rect) -> void;
907 auto exclude_clip(const xtd::drawing::rectangle_f& rect) -> void;
908
915 auto fill_closed_curve(const xtd::drawing::brush& brush, const xtd::array<xtd::drawing::point>& points) -> void;
922 auto fill_closed_curve(const xtd::drawing::brush& brush, const xtd::array<xtd::drawing::point_f>& points) -> void;
930 auto fill_closed_curve(const xtd::drawing::brush& brush, const xtd::array<xtd::drawing::point>& points, xtd::drawing::drawing_2d::fill_mode fill_mode) -> void;
938 auto fill_closed_curve(const xtd::drawing::brush& brush, const xtd::array<xtd::drawing::point_f>& points, xtd::drawing::drawing_2d::fill_mode fill_mode) -> void;
947 auto fill_closed_curve(const xtd::drawing::brush& brush, const xtd::array<xtd::drawing::point>& points, xtd::drawing::drawing_2d::fill_mode fill_mode, float tension) -> void;
956 auto fill_closed_curve(const xtd::drawing::brush& brush, const xtd::array<xtd::drawing::point_f>& points, xtd::drawing::drawing_2d::fill_mode fill_mode, float tension) -> void;
957
962 auto fill_ellipse(const xtd::drawing::brush& brush, const xtd::drawing::rectangle& rect) -> void;
967 auto fill_ellipse(const xtd::drawing::brush& brush, const xtd::drawing::rectangle_f& rect) -> void;
975 auto fill_ellipse(const xtd::drawing::brush& brush, xtd::int32 x, xtd::int32 y, xtd::int32 width, xtd::int32 height) -> void;
983 auto fill_ellipse(const xtd::drawing::brush& brush, float x, float y, float width, float height) -> void;
984
989 auto fill_path(const xtd::drawing::brush& brush, const xtd::drawing::drawing_2d::graphics_path& path) -> void;
990
998 auto fill_pie(const xtd::drawing::brush& brush, const xtd::drawing::rectangle& rect, float start_angle, float sweep_angle) -> void;
1006 auto fill_pie(const xtd::drawing::brush& brush, const xtd::drawing::rectangle_f& rect, float start_angle, float sweep_angle) -> void;
1017 auto fill_pie(const xtd::drawing::brush& brush, xtd::int32 x, xtd::int32 y, xtd::int32 width, xtd::int32 height, xtd::int32 start_angle, xtd::int32 sweep_angle) -> void;
1028 auto fill_pie(const xtd::drawing::brush& brush, float x, float y, float width, float height, float start_angle, float sweep_angle) -> void;
1029
1034 auto fill_polygon(const xtd::drawing::brush& brush, const xtd::array<xtd::drawing::point>& points) -> void;
1039 auto fill_polygon(const xtd::drawing::brush& brush, const xtd::array<xtd::drawing::point_f>& points) -> void;
1045 auto fill_polygon(const xtd::drawing::brush& brush, const xtd::array<xtd::drawing::point>& points, xtd::drawing::drawing_2d::fill_mode fill_mode) -> void;
1051 auto fill_polygon(const xtd::drawing::brush& brush, const xtd::array<xtd::drawing::point_f>& points, xtd::drawing::drawing_2d::fill_mode fill_mode) -> void;
1052
1057 auto fill_rectangle(const xtd::drawing::brush& brush, const xtd::drawing::rectangle& rect) -> void;
1062 auto fill_rectangle(const xtd::drawing::brush& brush, const xtd::drawing::rectangle_f& rect) -> void;
1070 auto fill_rectangle(const xtd::drawing::brush& brush, xtd::int32 x, xtd::int32 y, xtd::int32 width, xtd::int32 height) -> void;
1078 auto fill_rectangle(const xtd::drawing::brush& brush, float x, float y, float width, float height) -> void;
1079
1083 auto fill_rectangles(const xtd::drawing::brush& brush, const xtd::array<xtd::drawing::rectangle>& rects) -> void;
1087 auto fill_rectangles(const xtd::drawing::brush& brush, const xtd::array<xtd::drawing::rectangle_f>& rects) -> void;
1088
1093 auto fill_region(const xtd::drawing::brush& brush, const xtd::drawing::region& region) -> void;
1094
1100 auto fill_rounded_rectangle(const xtd::drawing::brush& brush, const xtd::drawing::rectangle& rect, xtd::int32 radius) -> void;
1106 auto fill_rounded_rectangle(const xtd::drawing::brush& brush, const xtd::drawing::rectangle_f& rect, float radius) -> void;
1115 auto fill_rounded_rectangle(const xtd::drawing::brush& brush, xtd::int32 x, xtd::int32 y, xtd::int32 width, xtd::int32 height, xtd::int32 radius) -> void;
1124 auto fill_rounded_rectangle(const xtd::drawing::brush& brush, float x, float y, float width, float height, float radius) -> void;
1125
1128 auto flush() -> void;
1132 auto flush(xtd::drawing::drawing_2d::flush_intention intention) -> void;
1133
1138 [[nodiscard]] auto get_hdc() const -> xtd::intptr;
1139
1143 [[nodiscard]] auto get_nearest_color(const xtd::drawing::color& color) const -> xtd::drawing::color;
1144
1148 auto intersect_clip(const xtd::drawing::region& region) -> void;
1152 auto intersect_clip(const xtd::drawing::rectangle& rect) -> void;
1156 auto intersect_clip(const xtd::drawing::rectangle_f& rect) -> void;
1157
1161 [[nodiscard]] auto is_visible(const xtd::drawing::rectangle& rect) -> bool;
1165 [[nodiscard]] auto is_visible(const xtd::drawing::rectangle_f& rect) -> bool;
1172 [[nodiscard]] auto is_visible(xtd::int32 x, xtd::int32 y, xtd::int32 width, xtd::int32 height) -> bool;
1179 [[nodiscard]] auto is_visible(float x, float y, float width, float height) -> bool;
1183 [[nodiscard]] auto is_visible(const xtd::drawing::point& point) -> bool;
1187 [[nodiscard]] auto is_visible(const xtd::drawing::point_f& point) -> bool;
1192 [[nodiscard]] auto is_visible(xtd::int32 x, xtd::int32 y) -> bool;
1197 [[nodiscard]] auto is_visible(float x, float y) -> bool;
1198
1203 [[nodiscard]] auto measure_string(const xtd::string& text, const xtd::drawing::font& font) -> xtd::drawing::size_f;
1209 [[nodiscard]] auto measure_string(const xtd::string& text, const xtd::drawing::font& font, const xtd::drawing::size_f& layout_area) -> xtd::drawing::size_f;
1215 [[nodiscard]] auto measure_string(const xtd::string& text, const xtd::drawing::font& font, xtd::int32 width) -> xtd::drawing::size_f;
1222 [[nodiscard]] auto measure_string(const xtd::string& text, const xtd::drawing::font& font, const xtd::drawing::point_f& origin, const xtd::drawing::string_format& format) -> xtd::drawing::size_f;
1229 [[nodiscard]] auto measure_string(const xtd::string& text, const xtd::drawing::font& font, const xtd::drawing::size_f& layout_area, const xtd::drawing::string_format& format) -> xtd::drawing::size_f;
1236 [[nodiscard]] auto measure_string(const xtd::string& text, const xtd::drawing::font& font, xtd::int32 width, const xtd::drawing::string_format& format) -> xtd::drawing::size_f;
1245 [[nodiscard]] auto measure_string(const xtd::string& text, const xtd::drawing::font& font, const xtd::drawing::size_f& layout_area, const xtd::drawing::string_format& format, xtd::usize characters_fitted, xtd::usize lines_filled) -> xtd::drawing::size_f;
1246
1250 auto multiply_transform(const xtd::drawing::drawing_2d::matrix& matrix) -> void;
1255 auto multiply_transform(const xtd::drawing::drawing_2d::matrix& matrix, xtd::drawing::drawing_2d::matrix_order order) -> void;
1256
1261 auto release_hdc(xtd::intptr hdc) -> void;
1262
1265 auto reset_clip() -> void;
1266
1269 auto reset_transform() -> void;
1270
1275 auto restore(const xtd::drawing::drawing_2d::graphics_state& gstate) -> void;
1276
1280 auto rotate_transform(float angle) -> void;
1285 auto rotate_transform(float angle, xtd::drawing::drawing_2d::matrix_order order) -> void;
1286
1291 [[nodiscard]] auto save() -> xtd::drawing::drawing_2d::graphics_state;
1292
1297 auto scale_transform(float sx, float sy) -> void;
1303 auto scale_transform(float sx, float sy, xtd::drawing::drawing_2d::matrix_order order) -> void;
1304
1308 auto translate_clip(xtd::int32 dx, xtd::int32 dy) -> void;
1312 auto translate_clip(float dx, float dy) -> void;
1313
1318 auto translate_transform(float dx, float dy) -> void;
1324 auto translate_transform(float dx, float dy, xtd::drawing::drawing_2d::matrix_order order) -> void;
1325
1331 [[nodiscard]] auto trim_string(const xtd::string& text, const xtd::drawing::font& font, float width, xtd::drawing::string_trimming trimming) -> xtd::string;
1332
1333 [[nodiscard]] auto to_string() const noexcept -> xtd::string override {return get_type().full_name();}
1335
1337
1344 [[nodiscard]] static auto from_hdc(xtd::intptr hdc) -> graphics;
1351 [[nodiscard]] static auto from_hdc(xtd::intptr hdc, xtd::intptr hdevice) -> graphics;
1352
1356 [[nodiscard]] static auto from_hwnd(xtd::intptr hwnd) -> graphics;
1357
1371 [[nodiscard]] static auto from_image(const xtd::drawing::image& image) -> graphics;
1373
1374 private:
1375 friend xtd::drawing::image;
1376 friend xtd::drawing::region;
1377 [[nodiscard]] auto to_page_unit(float value) const -> float;
1378 [[nodiscard]] static auto to_page_unit(float value, xtd::drawing::graphics_unit page_unit, float page_scale, float dpi) -> float;
1379 [[nodiscard]] auto to_pixels(xtd::int32 value) const -> xtd::int32;
1380 [[nodiscard]] auto to_pixels(float value) const -> float;
1381 [[nodiscard]] static auto to_pixels(float value, xtd::drawing::graphics_unit page_unit, float page_scale, float dpi) -> float;
1382 friend xtd::forms::control;
1385 friend xtd::forms::screen;
1386
1387 explicit graphics(xtd::intptr handle);
1388 graphics(xtd::intptr handle, const drawing::region& region);
1389 auto draw_image_disabled(const xtd::drawing::image& image, float x, float y, float width, float height, float brightness) -> void;
1390
1391 xtd::sptr<data> data_;
1392 };
1393 }
1394}
Contains xtd::drawing::brush class.
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition array.hpp:64
Defines objects used to fill the interiors of graphical shapes such as rectangles,...
Definition brush.hpp:33
Represents an ARGB (alpha, red, green, blue) color.
Definition color.hpp:52
Defines a particular format for text, including font face, size, and style attributes....
Definition font.hpp:45
auto draw_point(const xtd::drawing::pen &pen, const xtd::drawing::point &point) -> void
Draws a point specified by the coordinate pairs.
auto fill_closed_curve(const xtd::drawing::brush &brush, const xtd::array< xtd::drawing::point > &points) -> void
Fills the interior of a closed cardinal spline curve defined by an array of xtd::drawing::point struc...
auto compositing_mode() const noexcept -> xtd::drawing::drawing_2d::compositing_mode
Gets a value that specifies how composited images are drawn to this xtd::drawing::graphics.
auto translate_clip(xtd::int32 dx, xtd::int32 dy) -> void
Translates the clipping region of this xtd::drawing::graphics by specified amounts in the horizontal ...
auto draw_polygon(const xtd::drawing::pen &pen, const xtd::array< xtd::drawing::point > &points) -> void
Draws a polygon defined by an array of xtd::drawing::point structures.
auto interpolation_mode() const noexcept -> xtd::drawing::drawing_2d::interpolation_mode
Gets the interpolation mode associated with this xtd::drawing::graphics.
static auto from_hdc(xtd::intptr hdc) -> graphics
Creates a new xtd::drawing::graphics from the specified handle to a device context.
auto copy_from_screen(const xtd::drawing::point &upper_left_source, const xtd::drawing::point &upper_left_destination, const xtd::drawing::size &block_region_size) -> void
Performs a bit-block transfer of color data, corresponding to a rectangle of pixels,...
auto draw_icon_unstretched(const xtd::drawing::icon &icon, const xtd::drawing::rectangle &rect) -> void
Draws the image represented by the specified Icon without scaling the image.
auto get_hdc() const -> xtd::intptr
Gets the handle to the device context associated with this xtd::drawing::graphics.
auto draw_arc(const xtd::drawing::pen &pen, const xtd::drawing::rectangle &rect, float start_angle, float sweep_angle) -> void
Draws an arc representing a portion of an ellipse specified by a xtd::drawing::rectangle structure.
auto draw_image_unscaled(const xtd::drawing::image &image, const xtd::drawing::point &point) -> void
Draws a specified image using its original physical size at a specified location.
auto intersect_clip(const xtd::drawing::region &region) -> void
Updates the clip region of this xtd::drawing::graphics to the intersection of the current clip region...
auto fill_pie(const xtd::drawing::brush &brush, const xtd::drawing::rectangle &rect, float start_angle, float sweep_angle) -> void
Fills the interior of a pie section defined by an ellipse specified by a xtd::drawing::rectangle stru...
auto copy_from_graphics(const graphics &source, const xtd::drawing::point &upper_left_source, const xtd::drawing::point &upper_left_destination, const xtd::drawing::size &block_region_size) -> void
Performs a bit-block transfer of color data, corresponding to a rectangle of pixels,...
auto get_nearest_color(const xtd::drawing::color &color) const -> xtd::drawing::color
Gets the nearest color to the specified xtd::drawing::color structure.
auto draw_rectangles(const xtd::drawing::pen &pen, const xtd::array< xtd::drawing::rectangle > &rects) -> void
Draws a series of rectangles specified by xtd::drawing::rectangle structures.
static auto from_image(const xtd::drawing::image &image) -> graphics
Creates a new xtd::drawing::graphics from the specified xtd::drawing::image.
auto fill_ellipse(const xtd::drawing::brush &brush, const xtd::drawing::rectangle &rect) -> void
Fills the interior of an ellipse defined by a bounding rectangle specified by a xtd::drawing::rectang...
auto smoothing_mode() const noexcept -> xtd::drawing::drawing_2d::smoothing_mode
Gets the rendering quality for this xtd::drawing::graphics.
auto text_contrast() const noexcept -> xtd::int32
Gets the gamma correction value for rendering text.
auto to_string() const noexcept -> xtd::string override
Returns a xtd::string that represents the current object.
Definition graphics.hpp:1333
auto scale_transform(float sx, float sy) -> void
Applies the specified scaling operation to the transformation matrix of this xtd::drawing::graphics b...
auto measure_string(const xtd::string &text, const xtd::drawing::font &font) -> xtd::drawing::size_f
Measures the specified string when drawn with the specified xtd::drawing::font.
auto fill_rectangles(const xtd::drawing::brush &brush, const xtd::array< xtd::drawing::rectangle > &rects) -> void
Fills the interiors of a series of rectangles specified by xtd::drawing::rectangle structures.
auto visible_clip_bounds() const noexcept -> xtd::drawing::rectangle_f
Gets the bounding rectangle of the visible clipping region of this xtd::drawing::graphics.
auto draw_path(const xtd::drawing::pen &pen, const xtd::drawing::drawing_2d::graphics_path &path) -> void
Draws a xtd::drawing::drawing_2d::graphics_path.
auto draw_ellipse(const xtd::drawing::pen &pen, const xtd::drawing::rectangle &rect) -> void
Draws an ellipse specified by a bounding xtd::drawing::rectangle structure.
auto draw_pie(const xtd::drawing::pen &pen, const xtd::drawing::rectangle &rect, float start_angle, float sweep_angle) -> void
Draws a pie shape defined by an ellipse specified by a xtd::drawing::rectangle structure and two radi...
auto text_rendering_hint() const noexcept -> xtd::drawing::text::text_rendering_hint
Gets the rendering mode for text associated with this xtd::drawing::graphics.
auto release_hdc(xtd::intptr hdc) -> void
Releases a device context handle obtained by a previous call to the xtd::drawing::graphics::get_hdc()...
auto draw_image_unscaled_and_clipped(const xtd::drawing::image &image, const xtd::drawing::rectangle &rect) -> void
Draws the specified image without scaling and clips it, if necessary, to fit in the specified rectang...
auto fill_polygon(const xtd::drawing::brush &brush, const xtd::array< xtd::drawing::point > &points) -> void
Fills the interior of a polygon defined by an array of points specified by xtd::drawing::point struct...
auto page_scale() const noexcept -> float
Gets the scaling between world units and page units for this xtd::drawing::graphics.
auto dpi_x() const noexcept -> float
Gets the horizontal resolution of this xtd::drawing::graphics.
auto draw_image(const xtd::drawing::image &image, const xtd::drawing::rectangle &rect) -> void
Draws the specified xtd::drawing::image at the specified location and with the specified size.
auto fill_rectangle(const xtd::drawing::brush &brush, const xtd::drawing::rectangle &rect) -> void
Fills the interior of a rectangle specified by a xtd::drawing::rectangle structure.
auto draw_string(const xtd::string &s, const xtd::drawing::font &font, const xtd::drawing::brush &brush, const xtd::drawing::rectangle_f &layout_rectangle) -> void
Draws the specified text string at the specified rectangle with the specified xtd::drawing::brush and...
auto pixel_offset_mode() const noexcept -> xtd::drawing::drawing_2d::pixel_offset_mode
Gets a value specifying how pixels are offset during rendering of this xtd::drawing::graphics.
auto clear(const xtd::drawing::color &color) -> void
Clears the entire drawing surface and fills it with the specified background color.
auto trim_string(const xtd::string &text, const xtd::drawing::font &font, float width, xtd::drawing::string_trimming trimming) -> xtd::string
Trims the specified string for a specified width with the specified xtd::drawing::font and with the s...
auto is_visible(const xtd::drawing::rectangle &rect) -> bool
Indicates whether the rectangle specified by a xtd::drawing::rectangle structure is contained within ...
auto draw_icon(const xtd::drawing::icon &icon, xtd::int32 x, xtd::int32 y) -> void
Draws the image represented by the specified xtd::drawing::icon at the specified coordinates.
auto clip_bounds() const noexcept -> xtd::drawing::rectangle_f
Gets a xtd::drawing::rectangle_f structure that bounds the clipping region of this xtd::drawing::grap...
auto draw_bezier(const xtd::drawing::pen &pen, const xtd::drawing::point &pt1, const xtd::drawing::point &pt2, const xtd::drawing::point &pt3, const xtd::drawing::point &pt4) -> void
Draws a Bézier spline defined by four Point structures.
auto flush() -> void
Forces execution of all pending graphics operations and returns immediately without waiting for the o...
auto restore(const xtd::drawing::drawing_2d::graphics_state &gstate) -> void
Restores the state of this xtd::drawing::graphics to the state represented by a xtd::drawing::drawing...
auto clip() const noexcept -> xtd::drawing::region
Gets a xtd::drawing::region that limits the drawing region of this xtd::drawing::graphics.
static auto from_hwnd(xtd::intptr hwnd) -> graphics
Creates a new xtd::drawing::graphics from the specified handle to a window.
auto draw_beziers(const pen &pen, const xtd::array< xtd::drawing::point > &points) -> void
Draws a series of Bézier splines from an array of xtd::drawing::point structures.
auto fill_rounded_rectangle(const xtd::drawing::brush &brush, const xtd::drawing::rectangle &rect, xtd::int32 radius) -> void
Fills the interior of a rounded rectangle specified by a xtd::drawing::rectangle structure.
auto reset_transform() -> void
Resets the world transformation matrix of this xtd::drawing::graphics to the identity matrix.
auto reset_clip() -> void
Resets the clip region of this xtd::drawing::graphics to an infinite region.
auto draw_rotated_string(const xtd::string &s, const xtd::drawing::font &font, const xtd::drawing::brush &brush, const xtd::drawing::point_f &point, float angle) -> void
Draws the specified text string at the specified location with the specified xtd::drawing::brush,...
auto compositing_quality() const noexcept -> xtd::drawing::drawing_2d::compositing_quality
Gets the rendering quality of composited images drawn to this xtd::drawing::graphics.
static auto from_hdc(xtd::intptr hdc, xtd::intptr hdevice) -> graphics
Creates a new xtd::drawing::graphics from the specified handle to a device contextand handle to a dev...
auto exclude_clip(const xtd::drawing::region &region) -> void
Updates the clip region of this xtd::drawing::graphics to exclude the area specified by a xtd::drawin...
auto dpi_y() const noexcept -> float
Gets the vertical resolution of this xtd::drawing::graphics.
auto save() -> xtd::drawing::drawing_2d::graphics_state
Saves the current state of this xtd::drawing::graphics and identifies the saved state with a xtd::dra...
auto fill_path(const xtd::drawing::brush &brush, const xtd::drawing::drawing_2d::graphics_path &path) -> void
Fills the interior of a xtd::drawing::drawing_2d::graphics_path.
auto multiply_transform(const xtd::drawing::drawing_2d::matrix &matrix) -> void
Multiplies the world transformation of this xtd::drawing::graphics and specified the xtd::drawing::dr...
auto handle() const noexcept -> xtd::intptr
Gets the handle device context that the graphics is bound to.
auto page_unit() const noexcept -> xtd::drawing::graphics_unit
Gets or sets the unit of measure used for page coordinates in this xtd::drawing::graphics.
auto draw_line(const xtd::drawing::pen &pen, const xtd::drawing::point &pt1, const point &pt2) -> void
Draws a line connecting two xtd::drawing::point structures.
auto transform() const noexcept -> xtd::drawing::drawing_2d::matrix
Gets a copy of the geometric world transformation for this xtd::drawing::graphics.
auto translate_transform(float dx, float dy) -> void
Changes the origin of the coordinate system by prepending the specified translation to the transforma...
auto draw_rounded_rectangle(const xtd::drawing::pen &pen, const xtd::drawing::rectangle &rect, xtd::int32 radius) -> void
Draws a rounded rectangle specified by a xtd::drawing::rectangle structure, and radius.
auto draw_lines(const xtd::drawing::pen &pen, const xtd::array< xtd::drawing::point > &points) -> void
Draws a series of line segments that connect an array of xtd::drawing::point structures.
auto fill_region(const xtd::drawing::brush &brush, const xtd::drawing::region &region) -> void
Fills the interior of a xtd::drawing::region.
auto draw_curve(const pen &pen, const xtd::array< xtd::drawing::point > &points) -> void
Draws a cardinal spline through a specified array of xtd::drawing::point structures.
auto rotate_transform(float angle) -> void
Applies the specified rotation to the transformation matrix of this xtd::drawing::graphics.
auto draw_closed_curve(const pen &pen, const xtd::array< xtd::drawing::point > &points) -> void
Draws a closed cardinal spline defined by an array of xtd::drawing::point structures.
auto draw_rectangle(const xtd::drawing::pen &pen, const xtd::drawing::rectangle &rect) -> void
Draws a rectangle specified by a xtd::drawing::rectangle structure.
Represents a Windows icon, which is a small bitmap image that is used to represent an object....
Definition icon.hpp:28
An abstract base class that provides functionality for the bitmap and metafile descended classes.
Definition image.hpp:49
Defines an object used to draw lines and curves. This class cannot be inherited.
Definition pen.hpp:32
Describes the interior of a graphics shape composed of rectangles and paths. This class cannot be inh...
Definition region.hpp:32
Encapsulates text layout information (such as alignment, orientation and tab stops) display manipulat...
Definition string_format.hpp:30
Provides methods used to paint common Windows controls and their elements. This class cannot be inher...
Definition control_paint.hpp:39
Defines the base class for controls, which are components with visual representation.
Definition control.hpp:82
Provides data for the xtd::forms::control::paint event.
Definition paint_event_args.hpp:30
Represents a display device or multiple display devices on a single system.
Definition screen.hpp:32
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:45
virtual auto get_type() const noexcept -> type_object
Gets the type of the current instance.
Contains xtd::drawing::drawing_2d::compositing_mode enum class.
Contains xtd::drawing::drawing_2d::compositing_quality enum class.
Contains xtd::drawing::copy_pixel_operation enum class.
Contains xtd::drawing::color class.
Contains drawing_export_ keyword.
Contains xtd::drawing::drawing_2d::flush_intention enum class.
Contains xtd::drawing::font class.
Contains xtd::drawing::drawing_2d::graphics_path class.
Contains xtd::drawing::drawing_2d::graphics_state class.
Contains xtd::drawing::graphics_unit enum class.
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
string_trimming
Specifies how to trim characters from a string that does not completely fit into a layout shape.
Definition string_trimming.hpp:17
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
graphics_unit
Specifies the unit of measure for the given data. This enumeration has a flags attribute that allows ...
Definition graphics_unit.hpp:17
copy_pixel_operation
Determines how the source color in a copy pixel operation is combined with the destination color to r...
Definition copy_pixel_operation.hpp:18
Contains xtd::drawing::drawing_2d::interpolation_mode enum class.
Contains xtd::drawing::drawing_2d::matrix class.
Contains xtd::drawing::drawing_2d::matrix_order enum class.
The xtd::drawing::drawing_2d namespace provides advanced two-dimensional and vector graphics function...
Definition compositing_mode.hpp:12
The xtd::drawing::text namespace provides advanced GDI+ typography functionality.
Definition font_collection.hpp:14
The xtd::drawing namespace provides access to GDI+ basic graphics functionality. More advanced functi...
Definition actions_system_images.hpp:10
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition texts.hpp:219
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::pen class.
Contains xtd::drawing::drawing_2d::pixel_offset_mode enum class.
Contains xtd::drawing::point struct.
Contains xtd::drawing::point_f struct.
Contains xtd::drawing::rectangle struct.
Contains xtd::drawing::rectangle_f struct.
Contains xtd::drawing::region class.
Contains xtd::drawing::size struct.
Contains xtd::drawing::size_f struct.
Contains xtd::drawing::drawing_2d::smoothing_mode enum class.
Contains xtd::drawing::solid_brush 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
Stores an ordered pair of floating-point, which specify a height and width.
Definition size_f.hpp:32
Stores an ordered pair of integers, which specify a height and width.
Definition size.hpp:32
Contains xtd::drawing::text::text_rendering_hint enum class.