xtd 0.2.0
control_paint.h
Go to the documentation of this file.
1 #pragma once
5 #include "../forms_export.h"
6 #include "button_state.h"
7 #include "border_sides.h"
8 #include "border_style.h"
9 #include "image_layout.h"
10 #include "text_format_flags.h"
11 #include <xtd/optional>
12 #include <xtd/drawing/color>
13 #include <xtd/drawing/font>
14 #include <xtd/drawing/graphics>
15 #include <xtd/drawing/image>
16 #include <xtd/drawing/rectangle>
17 #include <xtd/drawing/string_format>
18 #include <xtd/drawing/system_fonts>
19 #include <string>
20 
22 namespace xtd {
24  namespace forms {
26  class control;
28 
37  class forms_export_ control_paint final static_ {
38  public:
40 
53  static xtd::drawing::color average(const xtd::drawing::color& color1, const xtd::drawing::color& color2, double weight, bool average_alpha);
54 
65  static xtd::drawing::color average(const xtd::drawing::color& color1, const xtd::drawing::color& color2, double weight);
66 
71  static xtd::drawing::color dark(const xtd::drawing::color& base_color);
76  static xtd::drawing::color dark(const xtd::drawing::color& base_color, double perc_of_dark_dark);
77 
82  static xtd::drawing::color dark_dark(const xtd::drawing::color& base_color);
83 
84  static void draw_button(const xtd::forms::control& control, xtd::drawing::graphics& graphics, const xtd::drawing::rectangle& rectangle, xtd::forms::button_state state);
85  static void draw_button(const xtd::forms::control& control, xtd::drawing::graphics& graphics, int32 x, int32 y, int32 width, int32 height, xtd::forms::button_state state);
86 
87 
88  static void draw_border(const xtd::forms::control& control, xtd::drawing::graphics& graphics, xtd::forms::border_style border, xtd::forms::border_sides sides, const xtd::drawing::color& color, const xtd::drawing::rectangle& rect);
89 
90  static void draw_border(const xtd::forms::control& control, xtd::drawing::graphics& graphics, xtd::forms::border_style border, xtd::forms::border_sides sides, const xtd::drawing::color& color, const xtd::drawing::rectangle& rect, bool light);
91 
92  static void draw_border_from_back_color(const xtd::forms::control& control, xtd::drawing::graphics& graphics, xtd::forms::border_style border, xtd::forms::border_sides sides, const xtd::drawing::color& back_color, const xtd::drawing::rectangle& rect);
93 
99  static void draw_image(xtd::drawing::graphics& graphics, const xtd::drawing::image& image, const xtd::drawing::rectangle& rectangle, xtd::forms::image_layout image_layout);
108  static void draw_image(xtd::drawing::graphics& graphics, const xtd::drawing::image& image, int32 x, int32 y, int32 width, int32 height, xtd::forms::image_layout image_layout);
109 
117  static void draw_image_disabled(xtd::drawing::graphics& graphics, const xtd::drawing::image& image, int32 x, int32 y, float brightness);
125  static void draw_image_disabled(xtd::drawing::graphics& graphics, const xtd::drawing::image& image, int32 x, int32 y, const xtd::drawing::color& background);
132  static void draw_image_disabled(xtd::drawing::graphics& graphics, const xtd::drawing::image& image, const xtd::drawing::point& location, float brightness);
139  static void draw_image_disabled(xtd::drawing::graphics& graphics, const xtd::drawing::image& image, const xtd::drawing::point& location, const xtd::drawing::color& background);
140 
145  static xtd::drawing::color light(const xtd::drawing::color& base_color);
150  static xtd::drawing::color light(const xtd::drawing::color& base_color, double perc_of_light_light);
151 
156  static xtd::drawing::color light_light(const xtd::drawing::color& base_color);
157 
163  };
164  }
165 }
Contains xtd::forms::button_state enum class.
#define static_
This keyword is use to represent a static object. A static object can&#39;t be instantiated (constructors...
Definition: static.h:37
Provides methods used to paint common Windows controls and their elements. This class cannot be inher...
Definition: control_paint.h:37
Represents an ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional ...
Definition: point.h:54
Enum flags attribute.
Specifies that the top edge of the control is defined.
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
Contains xtd::forms::text_format_flags enum class.
Specifies that the left edge of the control is defined.
Contains xtd::forms::image_layout enum class.
Specifies that the height of the control is defined.
Represents an ARGB (alpha, red, green, blue) color.
Definition: color.h:45
border_sides
Specifies how a control anchors to the edges of its container.
Definition: border_sides.h:21
Specifies that the width of the control is defined.
Stores a set of four integers that represent the location and size of a rectangle.
Definition: rectangle.h:44
border_style
Specifies the border style for a control.
Definition: border_style.h:20
An abstract base class that provides functionality for the bitmap and metafile descended classes...
Definition: image.h:48
Contains xtd::forms::border_sides enum class.
Defines the base class for controls, which are components with visual representation.
Definition: control.h:78
int_least32_t int32
Represents a 32-bit signed integer.
Definition: types.h:129
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition: about_box.h:13
text_format_flags
Specifies the display and layout information for text strings.
Definition: text_format_flags.h:20
button_state
Specifies the appearance of a button.
Definition: button_state.h:21
Specifies that both the x and y coordinates of the control are defined.
Defines an object used to draw lines and curves. This class cannot be inherited.
Definition: graphics.h:70
Contains xtd::forms::border_style enum class.
image_layout
Specifies the position of the image on the control.
Definition: image_layout.h:19
Encapsulates text layout information (such as alignment, orientation and tab stops) display manipulat...
Definition: string_format.h:30
The left or right CTRL modifier key.