xtd 0.2.0
drawing

## Definition

All needed for drawing something.

Remarks
A xtd::drawing::graphics class is create from xtd::forms::control::create_graphics or xtd::forms::screen::create_graphics or xtd::drawing::image::create_graphics.
And also when xtd::forms::control::paint event is sent, the xtd::forms::paint_event_args contains a xtd::drawing::graphics associate to the control event paint.
Collaboration diagram for drawing:

## Classes

class  xtd::drawing::basic_colors
Basic colors for all the hmtl basic colors. This class cannot be inherited. More...

class  xtd::drawing::bitmap
Encapsulates a GDI+ bitmap, which consists of the pixel data for a graphics image and its attributes. A bitmap is an object used to work with images defined by pixel data. More...

class  xtd::drawing::blue_colors
Blue colors for all the hmtl blue colors. This class cannot be inherited. More...

class  xtd::drawing::brown_colors
Brown colors for all the hmtl brown colors. This class cannot be inherited. More...

class  xtd::drawing::brush
Defines objects used to fill the interiors of graphical shapes such as rectangles, ellipses, pies, polygons, and paths. More...

class  xtd::drawing::brushes
brushes for all the standard colors. This class cannot be inherited. More...

class  xtd::drawing::color
Represents an ARGB (alpha, red, green, blue) color. More...

class  xtd::drawing::colors
colors for all the standard colors. This class cannot be inherited. More...

class  xtd::drawing::cyan_colors
Cyan colors for all the hmtl cyan colors. This class cannot be inherited. More...

Encapsulates a xtd::drawing::brush with a conical gradient. This class cannot be inherited. More...

class  xtd::drawing::drawing2d::graphics_path
Defines an object used to draw lines and curves. This class cannot be inherited. More...

class  xtd::drawing::drawing2d::graphics_state
Represents the state of a xtd::drawing::graphics object. This object is returned by a call to the xtd::drawing::graphics::save() methods. This class cannot be inherited. More...

class  xtd::drawing::drawing2d::hatch_brush
Defines a rectangular xtd::drawing::brush with a hatch style, a foreground color, and a background color. This class cannot be inherited. More...

Encapsulates a xtd::drawing::brush with a linear gradient. This class cannot be inherited. More...

class  xtd::drawing::drawing2d::matrix
Encapsulates a 3-by-3 affine matrix that represents a geometric transform. This class cannot be inherited. More...

Encapsulates a xtd::drawing::brush with a radial gradient. This class cannot be inherited. More...

class  xtd::drawing::font
Defines a particular format for text, including font face, size, and style attributes. This class cannot be inherited. More...

class  xtd::drawing::font_family
Defines a group of type faces having a similar basic design and certain variations in styles. This class cannot be inherited. More...

class  xtd::drawing::graphics
Defines an object used to draw lines and curves. This class cannot be inherited. More...

class  xtd::drawing::gray_colors
Gray and black colors for all the hmtl gray and black colors. This class cannot be inherited. More...

class  xtd::drawing::green_colors
Green colors for all the hmtl green colors. This class cannot be inherited. More...

class  xtd::drawing::icon
Represents a Windows icon, which is a small bitmap image that is used to represent an object. Icons can be thought of as transparent bitmaps, although their size is determined by the system. More...

class  xtd::drawing::image
An abstract base class that provides functionality for the bitmap and metafile descended classes. More...

class  xtd::drawing::orange_colors
Orange colors for all the hmtl orange colors. This class cannot be inherited. More...

class  xtd::drawing::pen
Defines an object used to draw lines and curves. This class cannot be inherited. More...

class  xtd::drawing::pens
pens for all the standard colors. This class cannot be inherited. More...

class  xtd::drawing::pink_colors
Pink colors for all the hmtl pink colors. This class cannot be inherited. More...

class  xtd::drawing::point
Represents an ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional plane. More...

class  xtd::drawing::point_f
Represents an ordered pair of floating-point x- and y-coordinates that defines a point in a two-dimensional plane. More...

class  xtd::drawing::purple_colors
Purple, violet and magenta colors for all the hmtl purple, violet and magenta colors. This class cannot be inherited. More...

class  xtd::drawing::rectangle
Stores a set of four integers that represent the location and size of a rectangle. More...

class  xtd::drawing::rectangle_f
Stores a set of four floating-point numbers that represent the location and size of a rectangle. For more advanced region functions, use a xtd::drawing::region object. More...

class  xtd::drawing::red_colors
Red colors for all the hmtl red colors. This class cannot be inherited. More...

class  xtd::drawing::region
Describes the interior of a graphics shape composed of rectangles and paths. This class cannot be inherited. More...

class  xtd::drawing::size
Stores an ordered pair of integers, which specify a height and width. More...

class  xtd::drawing::size_f
Stores an ordered pair of floating-point, which specify a height and width. More...

class  xtd::drawing::solid_brush
Defines a xtd::drawing::brush of a single color. Brushes are used to fill graphics shapes, such as rectangles, ellipses, pies, polygons, and paths. This class cannot be inherited. More...

class  xtd::drawing::system_brushes
Each property of the xtd::drawing::system_brushes class is a xtd::drawing::solid_brush that is the color of a Windows display element. More...

class  xtd::drawing::system_colors
Each property of the xtd::drawing::system_colors class is a xtd::drawing::color structure that is the color of a Windows display element. More...

class  xtd::drawing::system_fonts
Specifies the fonts used to display text in Windows display elements. More...

class  xtd::drawing::system_icons
Each property of the xtd::drawing::system_icons class is an xtd::drawing::icon object for Windows system-wide icons. This class cannot be inherited. More...

class  xtd::drawing::system_images
Each property of the xtd::drawing::system_images class is an xtd::drawing::image object for Windows system-wide images. This class cannot be inherited. More...

class  xtd::drawing::system_pens
Each property of the xtd::drawing::system_pens class is a xtd::drawing::xtd::drawing::pen that is the color of a Windows display element and that has a width of 1 pixel. More...

class  xtd::drawing::texture_brush
Each property of the xtd::drawing::texture_brush class is a xtd::drawing::brush object that uses an image to fill the interior of a shape. This class cannot be inherited. More...

class  xtd::drawing::white_colors
White colors for all the hmtl white colors. This class cannot be inherited. More...

class  xtd::drawing::yellow_colors
Yellow colors for all the hmtl yellow colors. This class cannot be inherited. More...

class  xtd::forms::control_paint
Provides methods used to paint common Windows controls and their elements. This class cannot be inherited. More...

## Typedefs

using xtd::drawing::black_colors = xtd::drawing::gray_colors
Gray and black colors for all the hmtl gray and black colors. More...

using xtd::drawing::extended_colors = xtd::drawing::colors
extended_colors for all the html extended colors. More...

using xtd::drawing::drawing2d::gradient_stop = std::pair< xtd::drawing::color, float >
Describes the location and color of a transition point in a gradient. More...

Represents a collection of xtd::drawing::drawing2d::gradient_stop objects that can be individually accessed by index. More...

using xtd::drawing::magenta_colors = xtd::drawing::purple_colors
Purple, violet and magenta colors for all the hmtl purple, violet and magenta colors. More...

using xtd::drawing::violet_colors = xtd::drawing::purple_colors
Purple, violet and magenta colors for all the hmtl purple, violet and magenta colors. More...

## Methods

graphics xtd::drawing::image::create_graphics ()
Creates the xtd::drawing::graphics for the image. More...

## Methods

drawing::graphics xtd::forms::control::create_graphics () const
Creates the xtd::drawing::graphics for the control. More...

## Methods

static drawing::graphics xtd::forms::screen::create_graphics ()
Creates the xtd::drawing::graphics for the screen. More...

static screen xtd::forms::screen::from_control (const control &control)
Retrieves a screen for the display that contains the largest portion of the specified control. More...

static screen xtd::forms::screen::from_handle (intptr handle)
Retrieves a screen for the display that contains the largest portion of the object referred to by the specified handle. More...

static screen xtd::forms::screen::from_point (const drawing::point &point)
Retrieves a screen for the display that contains the specified point. More...

static screen xtd::forms::screen::from_rectangle (const drawing::rectangle &rect)
Retrieves a screen for the display that contains the largest portion of the rectangle. More...

static drawing::rectangle xtd::forms::screen::get_bounds (const control &control)
Retrieves the bounds of the display that contains the largest portion of the specified control. More...

static drawing::rectangle xtd::forms::screen::get_bounds (intptr handle)
Retrieves the bounds of the display that contains the largest portion of the specified handle. More...

static drawing::rectangle xtd::forms::screen::get_bounds (const drawing::point &point)
Retrieves the bounds of the display that contains the specified point. More...

static drawing::rectangle xtd::forms::screen::get_bounds (const drawing::rectangle &rect)
Retrieves the bounds of the display that contains the largest portion of the specified rectangle. More...

static int32 xtd::forms::screen::get_standard_pixels_per_inch ()
Gets the the standard number of pixels per inch of the display. More...

static drawing::rectangle xtd::forms::screen::get_working_area (const control &control)
Retrieves the working area for the display that contains the largest region of the specified control. The working area is the desktop area of the display, excluding taskbars, docked windows, and docked tool bars. More...

static drawing::rectangle xtd::forms::screen::get_working_area (intptr handle)
Retrieves the working area for the display that contains the largest region of the specified handle. The working area is the desktop area of the display, excluding taskbars, docked windows, and docked tool bars. More...

static drawing::rectangle xtd::forms::screen::get_working_area (const drawing::point &point)
Retrieves the working area closest to the specified point. The working area is the desktop area of the display, excluding taskbars, docked windows, and docked tool bars. More...

static drawing::rectangle xtd::forms::screen::get_working_area (const drawing::rectangle &rect)
Retrieves the working area for the display that contains the largest portion of the specified rectangle. The working area is the desktop area of the display, excluding taskbars, docked windows, and docked tool bars. More...

## ◆ black_colors

 using xtd::drawing::black_colors = typedef xtd::drawing::gray_colors

#include <xtd.drawing/include/xtd/drawing/black_colors.h>

Gray and black colors for all the hmtl gray and black colors.

Namespace
xtd::drawing
Library
xtd.drawing

## ◆ extended_colors

 using xtd::drawing::extended_colors = typedef xtd::drawing::colors

#include <xtd.drawing/include/xtd/drawing/extended_colors.h>

extended_colors for all the html extended colors.

Namespace
xtd::drawing
Library
xtd.drawing

 using xtd::drawing::drawing2d::gradient_stop = typedef std::pair

#include <xtd.drawing/include/xtd/drawing/drawing2d/gradient_stop.h>

Describes the location and color of a transition point in a gradient.

Namespace
xtd::drawing::drawing2d
Library
xtd.drawing
Parameters
 color The color of the gradient stop. offset The location of the gradient stop within the gradient vector.
Remarks
A value of 0.0 specifies that the stop is positioned at the beginning of the gradient vector, while a value of 1.0 specifies that the stop is positioned at the end of the gradient vector.

 using xtd::drawing::drawing2d::gradient_stop_collection = typedef std::vector

#include <xtd.drawing/include/xtd/drawing/drawing2d/gradient_stop_collection.h>

Represents a collection of xtd::drawing::drawing2d::gradient_stop objects that can be individually accessed by index.

Namespace
xtd::drawing::drawing2d
Library
xtd.drawing

## ◆ magenta_colors

 using xtd::drawing::magenta_colors = typedef xtd::drawing::purple_colors

#include <xtd.drawing/include/xtd/drawing/magenta_colors.h>

Purple, violet and magenta colors for all the hmtl purple, violet and magenta colors.

Namespace
xtd::drawing
Library
xtd.drawing

## ◆ violet_colors

 using xtd::drawing::violet_colors = typedef xtd::drawing::purple_colors

#include <xtd.drawing/include/xtd/drawing/violet_colors.h>

Purple, violet and magenta colors for all the hmtl purple, violet and magenta colors.

Namespace
xtd::drawing
Library
xtd.drawing

## ◆ create_graphics() [1/3]

 static drawing::graphics xtd::forms::screen::create_graphics ( )
static

#include <xtd.forms/include/xtd/forms/screen.h>

Creates the xtd::drawing::graphics for the screen.

Returns
A xtd::drawing::graphics for the screen.

## ◆ create_graphics() [2/3]

 graphics xtd::drawing::image::create_graphics ( )

#include <xtd.drawing/include/xtd/drawing/image.h>

Creates the xtd::drawing::graphics for the image.

Returns
A xtd::drawing::graphics for the image.

## ◆ create_graphics() [3/3]

 drawing::graphics xtd::forms::control::create_graphics ( ) const

#include <xtd.forms/include/xtd/forms/control.h>

Creates the xtd::drawing::graphics for the control.

Returns
A xtd::drawing::graphics for the control.
Remarks
The graphics object that you retrieve through the create_graphics method should not normally be retained after the current Windows message has been processed, because anything painted with that object will be erased with the next WM_PAINT message. Therefore you cannot cache the graphics object for reuse, except to use non-visual methods like xtd::drawing::graphics::measure_string. Instead, you must call create_graphics every time that you want to use the graphics object.

## ◆ from_control()

 static screen xtd::forms::screen::from_control ( const control & control )
static

#include <xtd.forms/include/xtd/forms/screen.h>

Retrieves a screen for the display that contains the largest portion of the specified control.

Parameters
 control A xtd::forms::control for which to retrieve a Screen.
Returns
A screen for the display that contains the largest region of the specified control. In multiple display environments where no display contains the control, the display closest to the specified control is returned.

## ◆ from_handle()

 static screen xtd::forms::screen::from_handle ( intptr handle )
static

#include <xtd.forms/include/xtd/forms/screen.h>

Retrieves a screen for the display that contains the largest portion of the object referred to by the specified handle.

Parameters
 handle The window handle for which to retrieve the screen.
Returns
A screen for the display that contains the largest region of the object. In multiple display environments where no display contains any portion of the specified handle, the display closest to the object is returned.

## ◆ from_point()

 static screen xtd::forms::screen::from_point ( const drawing::point & point )
static

#include <xtd.forms/include/xtd/forms/screen.h>

Retrieves a screen for the display that contains the specified point.

Parameters
 point A xtd::drawing::point that specifies the location for which to retrieve a screen.
Returns
A screen for the display that contains the point. In multiple display environments where no display contains the point, the display closest to the specified point is returned.

## ◆ from_rectangle()

 static screen xtd::forms::screen::from_rectangle ( const drawing::rectangle & rect )
static

#include <xtd.forms/include/xtd/forms/screen.h>

Retrieves a screen for the display that contains the largest portion of the rectangle.

Parameters
 A xtd::drawing::rectangle that specifies the area for which to retrieve the display.
Returns
A screen for the display that contains the largest region of the specified rectangle. In multiple display environments where no display contains the rectangle, the display closest to the rectangle is returned.

## ◆ get_bounds() [1/4]

 static drawing::rectangle xtd::forms::screen::get_bounds ( const control & control )
static

#include <xtd.forms/include/xtd/forms/screen.h>

Retrieves the bounds of the display that contains the largest portion of the specified control.

Parameters
 control The control for which to retrieve the display bounds.
Returns
A xtd::drawing::rectangle that specifies the bounds of the display that contains the specified control. In multiple display environments where no display contains the specified control, the display closest to the control is returned.

## ◆ get_bounds() [2/4]

 static drawing::rectangle xtd::forms::screen::get_bounds ( intptr handle )
static

#include <xtd.forms/include/xtd/forms/screen.h>

Retrieves the bounds of the display that contains the largest portion of the specified handle.

Parameters
 handle The window handle for which to retrieve the display bounds.
Returns
A xtd::drawing::rectangle that specifies the bounds of the display that contains the specified handle. In multiple display environments where no display contains the specified handle, the display closest to the object is returned.

## ◆ get_bounds() [3/4]

 static drawing::rectangle xtd::forms::screen::get_bounds ( const drawing::point & point )
static

#include <xtd.forms/include/xtd/forms/screen.h>

Retrieves the bounds of the display that contains the specified point.

Parameters
 point A xtd::drawing::point that specifies the coordinates for which to retrieve the display bounds.
Returns
A xtd::drawing::rectangle that specifies the bounds of the display that contains the specified point. In multiple display environments where no display contains the specified point, the display closest to the point is returned.

## ◆ get_bounds() [4/4]

 static drawing::rectangle xtd::forms::screen::get_bounds ( const drawing::rectangle & rect )
static

#include <xtd.forms/include/xtd/forms/screen.h>

Retrieves the bounds of the display that contains the largest portion of the specified rectangle.

Parameters
 rect A xtd::drawing::rectangle that specifies the area for which to retrieve the display bounds.
Returns
A xtd::drawing::rectangle that specifies the bounds of the display that contains the specified rectangle. In multiple display environments where no monitor contains the specified rectangle, the monitor closest to the rectangle is returned.

## ◆ get_standard_pixels_per_inch()

 static int32 xtd::forms::screen::get_standard_pixels_per_inch ( )
static

#include <xtd.forms/include/xtd/forms/screen.h>

Gets the the standard number of pixels per inch of the display.

Returns
The standard number of pixels per inch of the display.
Remarks
In printing, DPI (dots per inch) refers to the output resolution of a printer, scanner or image setter, and PPI (pixels per inch) refers to the input resolution of a photograph, image or screen.
The following table shows the standard values by operating system :
Values and conversion Windows macOS linux
Pixels per inch (PPI) 96 72 96
Pixels per centimeters (pixel/cm) 38 28 38
Pitch (µm) 265 353 265

## ◆ get_working_area() [1/4]

 static drawing::rectangle xtd::forms::screen::get_working_area ( const control & control )
static

#include <xtd.forms/include/xtd/forms/screen.h>

Retrieves the working area for the display that contains the largest region of the specified control. The working area is the desktop area of the display, excluding taskbars, docked windows, and docked tool bars.

Parameters
 control The control for which to retrieve the working area.
Returns
A xtd::drawing::rectangle that specifies the working area. In multiple display environments where no display contains the specified control, the display closest to the control is returned.

## ◆ get_working_area() [2/4]

 static drawing::rectangle xtd::forms::screen::get_working_area ( intptr handle )
static

#include <xtd.forms/include/xtd/forms/screen.h>

Retrieves the working area for the display that contains the largest region of the specified handle. The working area is the desktop area of the display, excluding taskbars, docked windows, and docked tool bars.

Parameters
 handle The window handle for which to retrieve the working area.
Returns
A xtd::drawing::rectangle that specifies the working area. In multiple display environments where no display contains the specified handle, the display closest to the object is returned.

## ◆ get_working_area() [3/4]

 static drawing::rectangle xtd::forms::screen::get_working_area ( const drawing::point & point )
static

#include <xtd.forms/include/xtd/forms/screen.h>

Retrieves the working area closest to the specified point. The working area is the desktop area of the display, excluding taskbars, docked windows, and docked tool bars.

Parameters
 point A xtd::drawing::point that specifies the coordinates for which to retrieve the working area.
Returns
A xtd::drawing::rectangle that specifies the working area. In multiple display environments where no display contains the specified point, the display closest to the point is returned.

## ◆ get_working_area() [4/4]

 static drawing::rectangle xtd::forms::screen::get_working_area ( const drawing::rectangle & rect )
static

#include <xtd.forms/include/xtd/forms/screen.h>

Retrieves the working area for the display that contains the largest portion of the specified rectangle. The working area is the desktop area of the display, excluding taskbars, docked windows, and docked tool bars.

Parameters
 rect The xtd::drawing::rectangle that specifies the area for which to retrieve the working area.
Returns
A xtd::drawing::rectangle that specifies the working area. In multiple display environments where no display contains the specified rectangle, the display closest to the rectangle is returned.