xtd 0.2.0
Loading...
Searching...
No Matches
control_paint.h
Go to the documentation of this file.
1
4#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
22namespace xtd {
24 namespace forms {
26 class control;
28
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
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 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);
88
89 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);
90
91 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);
92
108
116 static void draw_image_disabled(xtd::drawing::graphics& graphics, const xtd::drawing::image& image, int32 x, int32 y, float brightness);
124 static void draw_image_disabled(xtd::drawing::graphics& graphics, const xtd::drawing::image& image, int32 x, int32 y, const xtd::drawing::color& background);
131 static void draw_image_disabled(xtd::drawing::graphics& graphics, const xtd::drawing::image& image, const xtd::drawing::point& location, float brightness);
138 static void draw_image_disabled(xtd::drawing::graphics& graphics, const xtd::drawing::image& image, const xtd::drawing::point& location, const xtd::drawing::color& background);
139
149 static xtd::drawing::color light(const xtd::drawing::color& base_color, double perc_of_light_light);
150
156
162 };
163 }
164}
Contains xtd::forms::border_sides enum class.
Contains xtd::forms::button_state enum class.
Represents an ARGB (alpha, red, green, blue) color.
Definition color.h:49
Defines an object used to draw lines and curves. This class cannot be inherited.
Definition graphics.h:70
An abstract base class that provides functionality for the bitmap and metafile descended classes.
Definition image.h:49
Represents an ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional ...
Definition point.h:54
Stores a set of four integers that represent the location and size of a rectangle.
Definition rectangle.h:44
Encapsulates text layout information (such as alignment, orientation and tab stops) display manipulat...
Definition string_format.h:30
Provides methods used to paint common Windows controls and their elements. This class cannot be inher...
Definition control_paint.h:37
static xtd::drawing::color dark(const xtd::drawing::color &base_color)
Creates a new dark color object for the control from the specified color.
static xtd::drawing::color average(const xtd::drawing::color &color1, const xtd::drawing::color &color2, double weight)
Returns the weighted average color between the two given colors.
static xtd::drawing::color light(const xtd::drawing::color &base_color, double perc_of_light_light)
Creates a new light color object for the control from the specified color and lightens it by the spec...
static xtd::drawing::color average(const xtd::drawing::color &color1, const xtd::drawing::color &color2, double weight, bool average_alpha)
Returns the weighted average color between the two given colors.
static xtd::drawing::string_format string_format(xtd::forms::text_format_flags flags)
Convert xtd::forms::text_format_flags to xtd::drawing::string_format.
static void draw_image(xtd::drawing::graphics &graphics, const xtd::drawing::image &image, const xtd::drawing::rectangle &rectangle, xtd::forms::image_layout image_layout)
Draws the specified image in a specified rectangle with specified layout.
static void draw_image_disabled(xtd::drawing::graphics &graphics, const xtd::drawing::image &image, int32 x, int32 y, const xtd::drawing::color &background)
Draws the specified image in a disabled state.
static void draw_image_disabled(xtd::drawing::graphics &graphics, const xtd::drawing::image &image, const xtd::drawing::point &location, const xtd::drawing::color &background)
Draws the specified image in a disabled state.
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)
Draws the specified image in a specified rectangle with specified layout.
static void draw_image_disabled(xtd::drawing::graphics &graphics, const xtd::drawing::image &image, const xtd::drawing::point &location, float brightness)
Draws the specified image in a disabled state.
static xtd::drawing::color dark_dark(const xtd::drawing::color &base_color)
Creates a new dark color object for the control from the specified color.
static void draw_image_disabled(xtd::drawing::graphics &graphics, const xtd::drawing::image &image, int32 x, int32 y, float brightness)
Draws the specified image in a disabled state.
static xtd::drawing::color light_light(const xtd::drawing::color &base_color)
Creates a new light color object for the control from the specified color.
static xtd::drawing::color light(const xtd::drawing::color &base_color)
Creates a new light color object for the control from the specified color.
static xtd::drawing::color dark(const xtd::drawing::color &base_color, double perc_of_dark_dark)
Creates a new dark color object for the control from the specified color and darkens it by the specif...
Defines the base class for controls, which are components with visual representation.
Definition control.h:79
#define static_
This keyword is use to represent a static object. A static object can't be instantiated (constructors...
Definition static.h:37
#define forms_export_
Define shared library export.
Definition forms_export.h:13
int_least32_t int32
Represents a 32-bit signed integer.
Definition types.h:131
@ control
The left or right CTRL modifier key.
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
image_layout
Specifies the position of the image on the control.
Definition image_layout.h:19
border_sides
Specifies how a control anchors to the edges of its container.
Definition border_sides.h:21
border_style
Specifies the border style for a control.
Definition border_style.h:20
Contains xtd::forms::image_layout enum class.
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition xtd_about_box.h:12
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10
Contains xtd::forms::style_sheets::border_style class.
Contains xtd::forms::text_format_flags enum class.