xtd 0.2.0
Loading...
Searching...
No Matches
xtd::forms::control_paint Class Referencefinal
Inheritance diagram for xtd::forms::control_paint:
xtd::static_object

Definition

Provides methods used to paint common Windows controls and their elements. This class cannot be inherited.

Header
#include <xtd/forms/control_paint>
Namespace
xtd::forms
Library
xtd.forms

Public Static Methods

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::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 dark (const xtd::drawing::color &base_color)
 Creates a new dark 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 specified percentage.
 
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_button (const xtd::forms::control &control, xtd::drawing::graphics &graphics, const xtd::drawing::rectangle &rectangle, xtd::forms::button_state state)
 
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)
 
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)
 
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)
 
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)
 
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 (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, int32 x, int32 y, float brightness)
 Draws the specified image in a disabled state.
 
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, float brightness)
 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 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 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 specified percentage.
 
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::string_format string_format (xtd::forms::text_format_flags flags)
 Convert xtd::forms::text_format_flags to xtd::drawing::string_format.
 

Member Function Documentation

◆ average() [1/2]

static xtd::drawing::color xtd::forms::control_paint::average ( const xtd::drawing::color color1,
const xtd::drawing::color color2,
double  weight,
bool  average_alpha 
)
static

Returns the weighted average color between the two given colors.

Parameters
color1The first color.
color2The second color.
weightThe weighting factor
average_alphaif true alpha was compute to; otherwise the alpha result is the alpha of color1
Returns
The average color.
Remarks
The alpha, red, green and blue values are averages using the following formula:
color = color1 * (1 - weight) + color2 * weight;
Thus, a weight value of 1.0 will return the first color, while a value of 0.0 will return the second color.

◆ average() [2/2]

static xtd::drawing::color xtd::forms::control_paint::average ( const xtd::drawing::color color1,
const xtd::drawing::color color2,
double  weight 
)
static

Returns the weighted average color between the two given colors.

Parameters
color1The first color.
color2The second color.
weightThe weighting factor
Returns
The average color.
Remarks
The red, green and blue values are averages using the following formula:
color = color1 * (1 - weight) + color2 * 1 - weight;
Thus, a weight value of 1.0 will return the second color, while a value of 0.0 will return the first color.

◆ dark() [1/2]

static xtd::drawing::color xtd::forms::control_paint::dark ( const xtd::drawing::color base_color)
static

Creates a new dark color object for the control from the specified color.

Parameters
colorThe xtd::drawing::color to be darkened.
Returns
A xtd::drawing::color that represents the dark color on the control.
Remarks
If the specified xtd::drawing::color is one of the xtd::drawing::system_color, the color is converted to a xtd::drawing::system_color.control_dark color; otherwise, the color's luminosity value is decreased.

◆ dark() [2/2]

static xtd::drawing::color xtd::forms::control_paint::dark ( const xtd::drawing::color base_color,
double  perc_of_dark_dark 
)
static

Creates a new dark color object for the control from the specified color and darkens it by the specified percentage.

Parameters
colorThe xtd::drawing::color to be darkened.
perc_of_darkThe percentage to darken the specified xtd::drawing::color.
Remarks
If the specified xtd::drawing::color is one of the xtd::drawing::system_color, the color is converted to a xtd::drawing::system_color.control_dark color; otherwise, the color's luminosity value is decreased.

◆ dark_dark()

static xtd::drawing::color xtd::forms::control_paint::dark_dark ( const xtd::drawing::color base_color)
static

Creates a new dark color object for the control from the specified color.

Parameters
colorThe xtd::drawing::color to be darkened.
Returns
A xtd::drawing::color that represents the dark color on the control.
Remarks
If the specified xtd::drawing::color is one of the xtd::drawing::system_color, the color is converted to a xtd::drawing::system_color.control_dark_dark color; otherwise, the color's luminosity value is decreased.

◆ draw_image() [1/2]

static void xtd::forms::control_paint::draw_image ( xtd::drawing::graphics graphics,
const xtd::drawing::image image,
const xtd::drawing::rectangle rectangle,
xtd::forms::image_layout  image_layout 
)
static

Draws the specified image in a specified rectangle with specified layout.

Parameters
xtd::drawing::graphicsThe Graphics to draw on.
imageThe xtd::drawing::image to draw.
rectanglextd::drawing::rectangle structure that defines the rectangle of the drawn image.
image_layoutOne of the values of xtd::forms::image_layout (center , none, stretch, tile, or zoom).

◆ draw_image() [2/2]

static void xtd::forms::control_paint::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 
)
static

Draws the specified image in a specified rectangle with specified layout.

Parameters
xtd::drawing::graphicsThe Graphics to draw on.
imageThe xtd::drawing::image to draw.
xThe x-coordinate of the top left of the drawn image.
yThe y-coordinate of the top left of the drawn image.
widthThe width of the drawn image.
heightThe height of the drawn image.
image_layoutOne of the values of xtd::forms::image_layout (center , none, stretch, tile, or zoom).

◆ draw_image_disabled() [1/4]

static void xtd::forms::control_paint::draw_image_disabled ( xtd::drawing::graphics graphics,
const xtd::drawing::image image,
int32  x,
int32  y,
float  brightness 
)
static

Draws the specified image in a disabled state.

Parameters
xtd::drawing::graphicsThe Graphics to draw on.
imageThe xtd::drawing::image to draw.
xThe x-coordinate of the top left of the border image.
yThe y-coordinate of the top left of the border image.
brightnessThe brightness (between 0.0 and 1.0 for drawing image disabled.
Remarks
The background parameter is used to calculate the fill color of the disabled image so that it is always visible against the background

◆ draw_image_disabled() [2/4]

static void xtd::forms::control_paint::draw_image_disabled ( xtd::drawing::graphics graphics,
const xtd::drawing::image image,
int32  x,
int32  y,
const xtd::drawing::color background 
)
static

Draws the specified image in a disabled state.

Parameters
xtd::drawing::graphicsThe Graphics to draw on.
imageThe xtd::drawing::image to draw.
xThe x-coordinate of the top left of the border image.
yThe y-coordinate of the top left of the border image.
backgroundThe xtd::drawing::color of the background behind the image.
Remarks
The background parameter is used to calculate the fill color of the disabled image so that it is always visible against the background

◆ draw_image_disabled() [3/4]

static void xtd::forms::control_paint::draw_image_disabled ( xtd::drawing::graphics graphics,
const xtd::drawing::image image,
const xtd::drawing::point location,
float  brightness 
)
static

Draws the specified image in a disabled state.

Parameters
xtd::drawing::graphicsThe Graphics to draw on.
imageThe xtd::drawing::image to draw.
locationThe xtd::drawing::point of the top left of the border image.
brightnessThe brightness (between 0.0 and 1.0 for drawing image disabled.
Remarks
The background parameter is used to calculate the fill color of the disabled image so that it is always visible against the background

◆ draw_image_disabled() [4/4]

static void xtd::forms::control_paint::draw_image_disabled ( xtd::drawing::graphics graphics,
const xtd::drawing::image image,
const xtd::drawing::point location,
const xtd::drawing::color background 
)
static

Draws the specified image in a disabled state.

Parameters
xtd::drawing::graphicsThe Graphics to draw on.
imageThe xtd::drawing::image to draw.
locationThe xtd::drawing::point of the top left of the border image.
backgroundThe xtd::drawing::color of the background behind the image.
Remarks
The background parameter is used to calculate the fill color of the disabled image so that it is always visible against the background

◆ light() [1/2]

static xtd::drawing::color xtd::forms::control_paint::light ( const xtd::drawing::color base_color)
static

Creates a new light color object for the control from the specified color.

Parameters
colorThe xtd::drawing::color to be lightened.
Returns
A xtd::drawing::color that represents the light color on the control.
Remarks
If the specified xtd::drawing::color is one of the xtd::drawing::system_color, the color is converted to a xtd::drawing::system_color.control_light color; otherwise, the color's luminosity value is decreased.

◆ light() [2/2]

static xtd::drawing::color xtd::forms::control_paint::light ( const xtd::drawing::color base_color,
double  perc_of_light_light 
)
static

Creates a new light color object for the control from the specified color and lightens it by the specified percentage.

Parameters
colorThe xtd::drawing::color to be lightened.
perc_of_lightThe percentage to lighten the specified xtd::drawing::color.
Remarks
If the specified xtd::drawing::color is one of the xtd::drawing::system_color, the color is converted to a xtd::drawing::system_color.control_light color; otherwise, the color's luminosity value is decreased.

◆ light_light()

static xtd::drawing::color xtd::forms::control_paint::light_light ( const xtd::drawing::color base_color)
static

Creates a new light color object for the control from the specified color.

Parameters
colorThe xtd::drawing::color to be lightened.
Returns
A xtd::drawing::color that represents the light color on the control.
Remarks
If the specified xtd::drawing::color is one of the xtd::drawing::system_color, the color is converted to a xtd::drawing::system_color.control_light_light color; otherwise, the color's luminosity value is decreased.

◆ string_format()

static xtd::drawing::string_format xtd::forms::control_paint::string_format ( xtd::forms::text_format_flags  flags)
static

Convert xtd::forms::text_format_flags to xtd::drawing::string_format.

Parameters
flagsa text_format_flags to convert.
Returns
A string_format converted.

The documentation for this class was generated from the following file: