xtd - Reference Guide  0.1.1
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
Classes | Functions
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.

Classes

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::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::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...
 
class  xtd::drawing::drawing2d::linear_gradient_brush
 Encapsulates a xtd::drawing::brush with a linear 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::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::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::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::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-points that represent the location and size of a rectangle. 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::forms::control_paint
 Provides methods used to paint common Windows controls and their elements. This class cannot be inherited. More...
 

Functions

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

Function Documentation

◆ create_graphics() [1/3]

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

#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() [2/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() [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.