xtd 0.2.0
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 xtd::drawing::region clip() const noexcept;
88 graphics& clip(const xtd::drawing::region value);
89
94 xtd::drawing::rectangle_f clip_bounds() const noexcept;
95
107
117
120 float dpi_x() const noexcept;
121
124 float dpi_y() const noexcept;
125
128 intptr handle() const noexcept;
129
139
142 float page_scale() const noexcept;
146 graphics& page_scale(float value) noexcept;
147
151 xtd::drawing::graphics_unit page_unit() const noexcept;
157 graphics& page_unit(xtd::drawing::graphics_unit value);
158
168
177 graphics& smoothing_mode(xtd::drawing::drawing_2d::smoothing_mode value) noexcept;
178
182 int32 text_contrast() const noexcept;
187 graphics& text_contrast(int32 value) noexcept;
188
200
205 xtd::drawing::drawing_2d::matrix transform() const noexcept;
211 graphics& transform(const xtd::drawing::drawing_2d::matrix& value) noexcept;
212
219
221
225 void clear(const color& color);
226
233 void 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);
241 void 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);
250 void copy_from_graphics(const graphics& source, int32 source_x, int32 source_y, int32 destination_x, int32 destination_y, const xtd::drawing::size& block_region_size);
260 void copy_from_graphics(const graphics& source, int32 source_x, int32 source_y, int32 destination_x, int32 destination_y, const xtd::drawing::size& block_region_size, xtd::drawing::copy_pixel_operation copy_pixel_operation);
261
267 void copy_from_screen(const xtd::drawing::point& upper_left_source, const xtd::drawing::point& upper_left_destination, const xtd::drawing::size& block_region_size);
274 void 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);
282 void copy_from_screen(int32 source_x, int32 source_y, int32 destination_x, int32 destination_y, const xtd::drawing::size& block_region_size);
291 void copy_from_screen(int32 source_x, int32 source_y, int32 destination_x, int32 destination_y, const xtd::drawing::size& block_region_size, xtd::drawing::copy_pixel_operation copy_pixel_operation);
292
299 void draw_arc(const xtd::drawing::pen& pen, const xtd::drawing::rectangle& rect, float start_angle, float sweep_angle);
306 void draw_arc(const xtd::drawing::pen& pen, const xtd::drawing::rectangle_f& rect, float start_angle, float sweep_angle);
316 void draw_arc(const xtd::drawing::pen& pen, int32 x, int32 y, int32 width, int32 height, int32 start_angle, int32 sweep_angle);
326 void draw_arc(const xtd::drawing::pen& pen, float x, float y, float width, float height, float start_angle, float sweep_angle);
327
335 void 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);
343 void 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);
355 void draw_bezier(const pen& pen, int32 x1, int32 y1, int32 x2, int32 y2, int32 x3, int32 y3, int32 x4, int32 y4);
367 void draw_bezier(const pen& pen, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4);
368
373 void draw_beziers(const pen& pen, const xtd::array<xtd::drawing::point>& points);
378 void draw_beziers(const pen& pen, const xtd::array<xtd::drawing::point_f>& points);
379
386 void draw_closed_curve(const pen& pen, const xtd::array<xtd::drawing::point>& points);
393 void draw_closed_curve(const pen& pen, const xtd::array<xtd::drawing::point_f>& points);
401 void draw_closed_curve(const pen& pen, const xtd::array<xtd::drawing::point>& points, float tension);
409 void draw_closed_curve(const pen& pen, const xtd::array<xtd::drawing::point_f>& points, float tension);
410
417 void draw_curve(const pen& pen, const xtd::array<xtd::drawing::point>& points);
424 void draw_curve(const pen& pen, const xtd::array<xtd::drawing::point_f>& points);
432 void draw_curve(const pen& pen, const xtd::array<xtd::drawing::point>& points, float tension);
440 void draw_curve(const pen& pen, const xtd::array<xtd::drawing::point_f>& points, float tension);
452 void draw_curve(const pen& pen, const xtd::array<xtd::drawing::point>& points, size_t offset, size_t number_of_segments);
464 void draw_curve(const pen& pen, const xtd::array<xtd::drawing::point_f>& points, size_t offset, size_t number_of_segments);
476 void draw_curve(const pen& pen, const xtd::array<xtd::drawing::point>& points, size_t offset, size_t number_of_segments, float tension);
488 void draw_curve(const pen& pen, const xtd::array<xtd::drawing::point_f>& points, size_t offset, size_t number_of_segments, float tension);
489
494 void draw_ellipse(const xtd::drawing::pen& pen, const xtd::drawing::rectangle& rect);
499 void draw_ellipse(const xtd::drawing::pen& pen, const xtd::drawing::rectangle_f& rect);
507 void draw_ellipse(const xtd::drawing::pen& pen, int32 x, int32 y, int32 width, int32 height);
515 void draw_ellipse(const xtd::drawing::pen& pen, float x, float y, float width, float height);
516
525 void draw_icon(const xtd::drawing::icon& icon, const xtd::drawing::rectangle& rect);
526
531
536 void draw_image(const xtd::drawing::image& image, const xtd::drawing::rectangle& rect);
541 void draw_image(const xtd::drawing::image& image, const xtd::drawing::rectangle_f& rect);
561 void draw_image(const xtd::drawing::image& image, int32 x, int32 y, int32 width, int32 height);
569 void draw_image(const xtd::drawing::image& image, float x, float y, float width, float height);
583 void draw_image(const xtd::drawing::image& image, float x, float y);
584
589 void draw_image(const xtd::drawing::image& image, const xtd::drawing::rectangle& dest_rect, const xtd::drawing::rectangle& src_rect);
594 void draw_image(const xtd::drawing::image& image, const xtd::drawing::rectangle_f& dest_rect, const xtd::drawing::rectangle_f& src_rect);
600 void draw_image(const xtd::drawing::image& image, const xtd::drawing::point& dest_point, const xtd::drawing::rectangle& src_rect);
606 void draw_image(const xtd::drawing::image& image, const xtd::drawing::point_f& dest_point, const xtd::drawing::rectangle_f& src_rect);
611 void draw_image(const xtd::drawing::image& image, const xtd::drawing::rectangle& dest_rect, int32 src_x, int32 src_y, int32 srd_width, int32 src_height);
616 void 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);
622 void draw_image(const xtd::drawing::image& image, const xtd::drawing::point& dest_point, int32 src_x, int32 src_y, int32 srd_width, int32 src_height);
628 void 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);
629
657 void draw_image_unscaled(const xtd::drawing::image& image, int32 x, int32 y, int32 width, int32 height);
658
663
668 void draw_line(const xtd::drawing::pen& pen, const xtd::drawing::point& pt1, const point& pt2);
673 void draw_line(const xtd::drawing::pen& pen, const xtd::drawing::point_f& pt1, const point_f& pt2);
681 void draw_line(const xtd::drawing::pen& pen, int32 x1, int32 y1, int32 x2, int32 y2);
689 void draw_line(const xtd::drawing::pen& pen, float x1, float y1, float x2, float y2);
690
695 void draw_lines(const xtd::drawing::pen& pen, const xtd::array<xtd::drawing::point>& points);
700 void draw_lines(const xtd::drawing::pen& pen, const xtd::array<xtd::drawing::point_f>& points);
701
706 void draw_path(const xtd::drawing::pen& pen, const xtd::drawing::drawing_2d::graphics_path& path);
707
715 void draw_pie(const xtd::drawing::pen& pen, const xtd::drawing::rectangle& rect, float start_angle, float sweep_angle);
723 void draw_pie(const xtd::drawing::pen& pen, const xtd::drawing::rectangle_f& rect, float start_angle, float sweep_angle);
734 void draw_pie(const xtd::drawing::pen& pen, int32 x, int32 y, int32 width, int32 height, int32 start_angle, int32 sweep_angle);
745 void draw_pie(const xtd::drawing::pen& pen, float x, float y, float width, float height, float start_angle, float sweep_angle);
746
751 void draw_polygon(const xtd::drawing::pen& pen, const xtd::array<xtd::drawing::point>& points);
756 void draw_polygon(const xtd::drawing::pen& pen, const xtd::array<xtd::drawing::point_f>& points);
757
761 void draw_point(const xtd::drawing::pen& pen, const xtd::drawing::point& point);
765 void draw_point(const xtd::drawing::pen& pen, const xtd::drawing::point_f& point);
775 void draw_point(const xtd::drawing::pen& pen, float x, float y);
776
780 void draw_rectangle(const xtd::drawing::pen& pen, const xtd::drawing::rectangle& rect);
784 void draw_rectangle(const xtd::drawing::pen& pen, const xtd::drawing::rectangle_f& rect);
791 void draw_rectangle(const xtd::drawing::pen& pen, int32 x, int32 y, int32 width, int32 height);
798 void draw_rectangle(const xtd::drawing::pen& pen, float x, float y, float width, float height);
799
803 void draw_rectangles(const xtd::drawing::pen& pen, const xtd::array<xtd::drawing::rectangle>& rects);
807 void draw_rectangles(const xtd::drawing::pen& pen, const xtd::array<xtd::drawing::rectangle_f>& rects);
808
815 void 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);
823 void draw_rotated_string(const xtd::string& s, const xtd::drawing::font& font, const xtd::drawing::brush& brush, float x, float y, float angle);
824
829 void draw_rounded_rectangle(const xtd::drawing::pen& pen, const xtd::drawing::rectangle& rect, int32 radius);
834 void draw_rounded_rectangle(const xtd::drawing::pen& pen, const xtd::drawing::rectangle_f& rect, float radius);
842 void draw_rounded_rectangle(const xtd::drawing::pen& pen, int32 x, int32 y, int32 width, int32 height, int32 radius);
850 void draw_rounded_rectangle(const xtd::drawing::pen& pen, float x, float y, float width, float height, float radius);
851
858 void draw_string(const xtd::string& s, const xtd::drawing::font& font, const xtd::drawing::brush& brush, const xtd::drawing::rectangle_f& layout_rectangle);
866 void 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);
872 void draw_string(const xtd::string& s, const xtd::drawing::font& font, const xtd::drawing::brush& brush, const xtd::drawing::point_f& point);
879 void 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);
886 void draw_string(const xtd::string& s, const xtd::drawing::font& font, const xtd::drawing::brush& brush, float x, float y);
894 void 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);
895
903 void exclude_clip(const xtd::drawing::rectangle& rect);
907 void exclude_clip(const xtd::drawing::rectangle_f& rect);
908
915 void fill_closed_curve(const xtd::drawing::brush& brush, const xtd::array<xtd::drawing::point>& points);
922 void fill_closed_curve(const xtd::drawing::brush& brush, const xtd::array<xtd::drawing::point_f>& points);
930 void fill_closed_curve(const xtd::drawing::brush& brush, const xtd::array<xtd::drawing::point>& points, xtd::drawing::drawing_2d::fill_mode fill_mode);
938 void fill_closed_curve(const xtd::drawing::brush& brush, const xtd::array<xtd::drawing::point_f>& points, xtd::drawing::drawing_2d::fill_mode fill_mode);
947 void 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);
956 void 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);
957
962 void fill_ellipse(const xtd::drawing::brush& brush, const xtd::drawing::rectangle& rect);
967 void fill_ellipse(const xtd::drawing::brush& brush, const xtd::drawing::rectangle_f& rect);
975 void fill_ellipse(const xtd::drawing::brush& brush, int32 x, int32 y, int32 width, int32 height);
983 void fill_ellipse(const xtd::drawing::brush& brush, float x, float y, float width, float height);
984
989 void fill_path(const xtd::drawing::brush& brush, const xtd::drawing::drawing_2d::graphics_path& path);
990
998 void fill_pie(const xtd::drawing::brush& brush, const xtd::drawing::rectangle& rect, float start_angle, float sweep_angle);
1006 void fill_pie(const xtd::drawing::brush& brush, const xtd::drawing::rectangle_f& rect, float start_angle, float sweep_angle);
1017 void fill_pie(const xtd::drawing::brush& brush, int32 x, int32 y, int32 width, int32 height, int32 start_angle, int32 sweep_angle);
1028 void fill_pie(const xtd::drawing::brush& brush, float x, float y, float width, float height, float start_angle, float sweep_angle);
1029
1034 void fill_polygon(const xtd::drawing::brush& brush, const xtd::array<xtd::drawing::point>& points);
1039 void fill_polygon(const xtd::drawing::brush& brush, const xtd::array<xtd::drawing::point_f>& points);
1045 void fill_polygon(const xtd::drawing::brush& brush, const xtd::array<xtd::drawing::point>& points, xtd::drawing::drawing_2d::fill_mode fill_mode);
1051 void fill_polygon(const xtd::drawing::brush& brush, const xtd::array<xtd::drawing::point_f>& points, xtd::drawing::drawing_2d::fill_mode fill_mode);
1052
1057 void fill_rectangle(const xtd::drawing::brush& brush, const xtd::drawing::rectangle& rect);
1070 void fill_rectangle(const xtd::drawing::brush& brush, int32 x, int32 y, int32 width, int32 height);
1078 void fill_rectangle(const xtd::drawing::brush& brush, float x, float y, float width, float height);
1079
1088
1094
1100 void fill_rounded_rectangle(const xtd::drawing::brush& brush, const xtd::drawing::rectangle& rect, int32 radius);
1106 void fill_rounded_rectangle(const xtd::drawing::brush& brush, const xtd::drawing::rectangle_f& rect, float radius);
1115 void fill_rounded_rectangle(const xtd::drawing::brush& brush, int32 x, int32 y, int32 width, int32 height, int32 radius);
1124 void fill_rounded_rectangle(const xtd::drawing::brush& brush, float x, float y, float width, float height, float radius);
1125
1128 void flush();
1132 void flush(xtd::drawing::drawing_2d::flush_intention intention);
1133
1139
1144
1157
1161 bool is_visible(const xtd::drawing::rectangle& rect);
1165 bool is_visible(const xtd::drawing::rectangle_f& rect);
1172 bool is_visible(int32 x, int32 y, int32 width, int32 height);
1179 bool is_visible(float x, float y, float width, float height);
1197 bool is_visible(float x, float y);
1198
1203 size_f measure_string(const xtd::string& text, const xtd::drawing::font& font);
1209 size_f measure_string(const xtd::string& text, const xtd::drawing::font& font, const xtd::drawing::size_f& layout_area);
1215 size_f measure_string(const xtd::string& text, const xtd::drawing::font& font, int32 width);
1222 size_f measure_string(const xtd::string& text, const xtd::drawing::font& font, const xtd::drawing::point_f& origin, const xtd::drawing::string_format& format);
1229 size_f measure_string(const xtd::string& text, const xtd::drawing::font& font, const xtd::drawing::size_f& layout_area, const xtd::drawing::string_format& format);
1236 size_f measure_string(const xtd::string& text, const xtd::drawing::font& font, int32 width, const xtd::drawing::string_format& format);
1245 size_f measure_string(const xtd::string& text, const xtd::drawing::font& font, const xtd::drawing::size_f& layout_area, const xtd::drawing::string_format& format, size_t characters_fitted, size_t lines_filled);
1246
1250 void multiply_transform(const xtd::drawing::drawing_2d::matrix& matrix);
1255 void multiply_transform(const xtd::drawing::drawing_2d::matrix& matrix, xtd::drawing::drawing_2d::matrix_order order);
1256
1262
1266
1270
1275 void restore(const xtd::drawing::drawing_2d::graphics_state& gstate);
1276
1280 void rotate_transform(float angle);
1285 void rotate_transform(float angle, xtd::drawing::drawing_2d::matrix_order order);
1286
1291 xtd::drawing::drawing_2d::graphics_state save();
1292
1297 void scale_transform(float sx, float sy);
1303 void scale_transform(float sx, float sy, xtd::drawing::drawing_2d::matrix_order order);
1304
1312 void translate_clip(float dx, float dy);
1313
1318 void translate_transform(float dx, float dy);
1324 void translate_transform(float dx, float dy, xtd::drawing::drawing_2d::matrix_order order);
1325
1331 xtd::string trim_string(const xtd::string& text, const xtd::drawing::font& font, float width, xtd::drawing::string_trimming trimming);
1332
1333 xtd::string to_string() const noexcept override {return get_type().full_name();}
1335
1337
1344 static graphics from_hdc(intptr hdc);
1351 static graphics from_hdc(intptr hdc, intptr hdevice);
1352
1356 static graphics from_hwnd(intptr hwnd);
1357
1371 static graphics from_image(const xtd::drawing::image& image);
1373
1374 private:
1375 friend xtd::drawing::image;
1376 friend xtd::drawing::region;
1377 float to_page_unit(float value) const;
1378 static float to_page_unit(float value, xtd::drawing::graphics_unit page_unit, float page_scale, float dpi);
1379 int32 to_pixels(int32 value) const;
1380 float to_pixels(float value) const;
1381 static float to_pixels(float value, xtd::drawing::graphics_unit page_unit, float page_scale, float dpi);
1382 friend xtd::forms::control;
1385 friend xtd::forms::screen;
1386
1387 explicit graphics(intptr handle);
1388 graphics(intptr handle, const drawing::region& region);
1389 void draw_image_disabled(const xtd::drawing::image& image, float x, float y, float width, float height, float brightness);
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:61
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:46
Defines a particular format for text, including font face, size, and style attributes....
Definition font.hpp:45
void fill_path(const xtd::drawing::brush &brush, const xtd::drawing::drawing_2d::graphics_path &path)
Fills the interior of a xtd::drawing::drawing_2d::graphics_path.
xtd::drawing::rectangle_f visible_clip_bounds() const noexcept
Gets the bounding rectangle of the visible clipping region of this xtd::drawing::graphics.
xtd::drawing::drawing_2d::pixel_offset_mode pixel_offset_mode() const noexcept
Gets a value specifying how pixels are offset during rendering of this xtd::drawing::graphics.
static graphics from_hdc(intptr hdc)
Creates a new xtd::drawing::graphics from the specified handle to a device context.
void scale_transform(float sx, float sy)
Applies the specified scaling operation to the transformation matrix of this xtd::drawing::graphics b...
void draw_rectangle(const xtd::drawing::pen &pen, const xtd::drawing::rectangle &rect)
Draws a rectangle specified by a xtd::drawing::rectangle structure.
xtd::drawing::drawing_2d::matrix transform() const noexcept
Gets a copy of the geometric world transformation for this xtd::drawing::graphics.
xtd::drawing::drawing_2d::smoothing_mode smoothing_mode() const noexcept
Gets the rendering quality for this xtd::drawing::graphics.
bool is_visible(const xtd::drawing::rectangle &rect)
Indicates whether the rectangle specified by a xtd::drawing::rectangle structure is contained within ...
void reset_clip()
Resets the clip region of this xtd::drawing::graphics to an infinite region.
void multiply_transform(const xtd::drawing::drawing_2d::matrix &matrix)
Multiplies the world transformation of this xtd::drawing::graphics and specified the xtd::drawing::dr...
xtd::string trim_string(const xtd::string &text, const xtd::drawing::font &font, float width, xtd::drawing::string_trimming trimming)
Trims the specified string for a specified width with the specified xtd::drawing::font and with the s...
void draw_line(const xtd::drawing::pen &pen, const xtd::drawing::point &pt1, const point &pt2)
Draws a line connecting two xtd::drawing::point structures.
float dpi_x() const noexcept
Gets the horizontal resolution of this xtd::drawing::graphics.
float page_scale() const noexcept
Gets the scaling between world units and page units for this xtd::drawing::graphics.
void restore(const xtd::drawing::drawing_2d::graphics_state &gstate)
Restores the state of this xtd::drawing::graphics to the state represented by a xtd::drawing::drawing...
void fill_closed_curve(const xtd::drawing::brush &brush, const xtd::array< xtd::drawing::point > &points)
Fills the interior of a closed cardinal spline curve defined by an array of xtd::drawing::point struc...
xtd::drawing::text::text_rendering_hint text_rendering_hint() const noexcept
Gets the rendering mode for text associated with this xtd::drawing::graphics.
void fill_rectangles(const xtd::drawing::brush &brush, const xtd::array< xtd::drawing::rectangle > &rects)
Fills the interiors of a series of rectangles specified by xtd::drawing::rectangle structures.
int32 text_contrast() const noexcept
Gets the gamma correction value for rendering text.
void fill_polygon(const xtd::drawing::brush &brush, const xtd::array< xtd::drawing::point > &points)
Fills the interior of a polygon defined by an array of points specified by xtd::drawing::point struct...
void release_hdc(intptr hdc)
Releases a device context handle obtained by a previous call to the xtd::drawing::graphics::get_hdc()...
void translate_transform(float dx, float dy)
Changes the origin of the coordinate system by prepending the specified translation to the transforma...
void exclude_clip(const xtd::drawing::region &region)
Updates the clip region of this xtd::drawing::graphics to exclude the area specified by a xtd::drawin...
void 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)
Performs a bit-block transfer of color data, corresponding to a rectangle of pixels,...
void 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)
Draws the specified text string at the specified location with the specified xtd::drawing::brush,...
void clear(const color &color)
Clears the entire drawing surface and fills it with the specified background color.
void translate_clip(int32 dx, int32 dy)
Translates the clipping region of this xtd::drawing::graphics by specified amounts in the horizontal ...
static graphics from_hdc(intptr hdc, intptr hdevice)
Creates a new xtd::drawing::graphics from the specified handle to a device contextand handle to a dev...
void fill_rounded_rectangle(const xtd::drawing::brush &brush, const xtd::drawing::rectangle &rect, int32 radius)
Fills the interior of a rounded rectangle specified by a xtd::drawing::rectangle structure.
void reset_transform()
Resets the world transformation matrix of this xtd::drawing::graphics to the identity matrix.
void draw_string(const xtd::string &s, const xtd::drawing::font &font, const xtd::drawing::brush &brush, const xtd::drawing::rectangle_f &layout_rectangle)
Draws the specified text string at the specified rectangle with the specified xtd::drawing::brush and...
xtd::string to_string() const noexcept override
Returns a xtd::string that represents the current object.
Definition graphics.hpp:1333
intptr get_hdc() const
Gets the handle to the device context associated with this xtd::drawing::graphics.
xtd::drawing::color get_nearest_color(const xtd::drawing::color &color) const
Gets the nearest color to the specified xtd::drawing::color structure.
void flush()
Forces execution of all pending graphics operations and returns immediately without waiting for the o...
void draw_point(const xtd::drawing::pen &pen, const xtd::drawing::point &point)
Draws a point specified by the coordinate pairs.
void fill_ellipse(const xtd::drawing::brush &brush, const xtd::drawing::rectangle &rect)
Fills the interior of an ellipse defined by a bounding rectangle specified by a xtd::drawing::rectang...
void draw_rounded_rectangle(const xtd::drawing::pen &pen, const xtd::drawing::rectangle &rect, int32 radius)
Draws a rounded rectangle specified by a xtd::drawing::rectangle structure, and radius.
void draw_polygon(const xtd::drawing::pen &pen, const xtd::array< xtd::drawing::point > &points)
Draws a polygon defined by an array of xtd::drawing::point structures.
void fill_rectangle(const xtd::drawing::brush &brush, const xtd::drawing::rectangle &rect)
Fills the interior of a rectangle specified by a xtd::drawing::rectangle structure.
size_f measure_string(const xtd::string &text, const xtd::drawing::font &font)
Measures the specified string when drawn with the specified xtd::drawing::font.
float dpi_y() const noexcept
Gets the vertical resolution of this xtd::drawing::graphics.
void draw_ellipse(const xtd::drawing::pen &pen, const xtd::drawing::rectangle &rect)
Draws an ellipse specified by a bounding xtd::drawing::rectangle structure.
void draw_image_unscaled_and_clipped(const xtd::drawing::image &image, const xtd::drawing::rectangle &rect)
Draws the specified image without scaling and clips it, if necessary, to fit in the specified rectang...
void draw_image_unscaled(const xtd::drawing::image &image, const xtd::drawing::point &point)
Draws a specified image using its original physical size at a specified location.
static graphics from_hwnd(intptr hwnd)
Creates a new xtd::drawing::graphics from the specified handle to a window.
xtd::drawing::graphics_unit page_unit() const noexcept
Gets or sets the unit of measure used for page coordinates in this xtd::drawing::graphics.
void draw_rectangles(const xtd::drawing::pen &pen, const xtd::array< xtd::drawing::rectangle > &rects)
Draws a series of rectangles specified by xtd::drawing::rectangle structures.
void draw_arc(const xtd::drawing::pen &pen, const xtd::drawing::rectangle &rect, float start_angle, float sweep_angle)
Draws an arc representing a portion of an ellipse specified by a xtd::drawing::rectangle structure.
xtd::drawing::drawing_2d::compositing_quality compositing_quality() const noexcept
Gets the rendering quality of composited images drawn to this xtd::drawing::graphics.
void draw_closed_curve(const pen &pen, const xtd::array< xtd::drawing::point > &points)
Draws a closed cardinal spline defined by an array of xtd::drawing::point structures.
void 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)
Draws a Bézier spline defined by four Point structures.
void draw_image(const xtd::drawing::image &image, const xtd::drawing::rectangle &rect)
Draws the specified xtd::drawing::image at the specified location and with the specified size.
void draw_curve(const pen &pen, const xtd::array< xtd::drawing::point > &points)
Draws a cardinal spline through a specified array of xtd::drawing::point structures.
intptr handle() const noexcept
Gets the handle device context that the graphics is bound to.
void draw_beziers(const pen &pen, const xtd::array< xtd::drawing::point > &points)
Draws a series of Bézier splines from an array of xtd::drawing::point structures.
xtd::drawing::region clip() const noexcept
Gets a xtd::drawing::region that limits the drawing region of this xtd::drawing::graphics.
void copy_from_screen(const xtd::drawing::point &upper_left_source, const xtd::drawing::point &upper_left_destination, const xtd::drawing::size &block_region_size)
Performs a bit-block transfer of color data, corresponding to a rectangle of pixels,...
void fill_region(const xtd::drawing::brush &brush, const xtd::drawing::region &region)
Fills the interior of a xtd::drawing::region.
static graphics from_image(const xtd::drawing::image &image)
Creates a new xtd::drawing::graphics from the specified xtd::drawing::image.
void draw_icon_unstretched(const xtd::drawing::icon &icon, const xtd::drawing::rectangle &rect)
Draws the image represented by the specified Icon without scaling the image.
void draw_pie(const xtd::drawing::pen &pen, const xtd::drawing::rectangle &rect, float start_angle, float sweep_angle)
Draws a pie shape defined by an ellipse specified by a xtd::drawing::rectangle structure and two radi...
void intersect_clip(const xtd::drawing::region &region)
Updates the clip region of this xtd::drawing::graphics to the intersection of the current clip region...
void fill_pie(const xtd::drawing::brush &brush, const xtd::drawing::rectangle &rect, float start_angle, float sweep_angle)
Fills the interior of a pie section defined by an ellipse specified by a xtd::drawing::rectangle stru...
void draw_lines(const xtd::drawing::pen &pen, const xtd::array< xtd::drawing::point > &points)
Draws a series of line segments that connect an array of xtd::drawing::point structures.
xtd::drawing::drawing_2d::graphics_state save()
Saves the current state of this xtd::drawing::graphics and identifies the saved state with a xtd::dra...
void draw_icon(const xtd::drawing::icon &icon, int32 x, int32 y)
Draws the image represented by the specified xtd::drawing::icon at the specified coordinates.
void draw_path(const xtd::drawing::pen &pen, const xtd::drawing::drawing_2d::graphics_path &path)
Draws a xtd::drawing::drawing_2d::graphics_path.
xtd::drawing::drawing_2d::compositing_mode compositing_mode() const noexcept
Gets a value that specifies how composited images are drawn to this xtd::drawing::graphics.
xtd::drawing::rectangle_f clip_bounds() const noexcept
Gets a xtd::drawing::rectangle_f structure that bounds the clipping region of this xtd::drawing::grap...
xtd::drawing::drawing_2d::interpolation_mode interpolation_mode() const noexcept
Gets the interpolation mode associated with this xtd::drawing::graphics.
void rotate_transform(float angle)
Applies the specified rotation to the transformation matrix of this xtd::drawing::graphics.
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:81
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:44
virtual type_object get_type() const noexcept
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.
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
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
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
@ path
The xtd::uri::local_path data.
Definition uri_components.hpp:27
@ 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
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 const_pointer data() const noexcept
Gets direct access to the underlying contiguous storage.
Definition read_only_span.hpp:201
Contains xtd::drawing::pen class.
Contains xtd::drawing::drawing_2d::pixel_offset_mode enum class.
Contains xtd::drawing::point class.
Contains xtd::drawing::point_f class.
Contains xtd::drawing::rectangle class.
Contains xtd::drawing::rectangle_f class.
Contains xtd::drawing::region class.
Contains xtd::drawing::size_f class.
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:31
Stores an ordered pair of integers, which specify a height and width.
Definition size.hpp:31
Contains xtd::drawing::text::text_rendering_hint enum class.
Contains xtd::drawing::size class.