xtd.drawing - Reference Guide  0.1.0
Modern c++17 library providing access to GDI+ basic graphics functionality. More advanced functionality is provided in the drawing 2D, imaging, and text.
xtd::drawing Namespace Reference

The xtd::drawing namespace provides access to GDI+ basic graphics functionality. More advanced functionality is provided in the xtd::drawing::drawing_2d, xtd::drawing::imaging, and xtd::drawing::text namespaces. More...

Namespaces

 drawing2d
 The xtd::.drawing::drawing2d namespace provides advanced two-dimensional and vector graphics functionality.
 
 imaging
 The xtd.drawing.imaging namespace provides advanced GDI+ imaging functionality.
 
 text
 The xtd::drawing::text namespace provides advanced GDI+ typography functionality.
 

Classes

class  bitmap
 Encapsulates a GDI+ bitmap, which consists of the pixel data for a graphics image and its attributes. More...
 
class  brush
 Defines an object used to draw lines and curves. This class cannot be inherited. More...
 
class  brushes
 brushes for all the standard colors. More...
 
class  color
 Represents an ARGB (alpha, red, green, blue) color. More...
 
class  font
 Defines a particular format for text, including font face, size, and style attributes. This class cannot be inherited. More...
 
class  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  icon
 
class  image
 An abstract base class that provides functionality for the bitmap and metafile descended classes. More...
 
class  pens
 pens for all the standard colors. More...
 
class  point
 Represents an ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional plane. More...
 
class  point_f
 
class  rectangle
 
class  rectangle_f
 
class  size
 Stores an ordered pair of integers, which specify a height and width. More...
 
class  size_f
 Stores an ordered pair of integers, which specify a height and width. More...
 
class  solid_brush
 Defines an object used to draw lines and curves. This class cannot be inherited. More...
 
class  string_format
 Encapsulates text layout information (such as alignment, orientation and tab stops) display manipulations (such as ellipsis insertion and national digit substitution) and OpenType features. More...
 
class  system_brushes
 Each property of the system_brushes class is a solid_brush that is the color of a Windows display element. More...
 
class  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  system_fonts
 Specifies the fonts used to display text in Windows display elements. More...
 
class  system_icons
 Each property of the system_icons class is an icon object for Windows system-wide icons. More...
 
class  system_images
 Each property of the system_images class is an image object for Windows system-wide images. More...
 
class  system_pens
 Each property of the system_pens class is a pen that is the color of a Windows display element and that has a width of 1 pixel. More...
 

Enumerations

enum  dash_style {
  dash_style::solid = 0, dash_style::dash, dash_style::dot, dash_style::dash_dot,
  dash_style::dash_dot_dot, dash_style::custom
}
 Specifies the style of dashed lines drawn with a xtd::drawing::pen object. More...
 
enum  font_style {
  font_style::regular = 0, font_style::bold = 0b1, font_style::italic = 0b10, font_style::underline = 0b100,
  font_style::strikeout = 0b1000
}
 Specifies style information applied to text. This enumeration has a flags attribute that allows a bitwise combination of its member values. More...
 
enum  graphics_unit {
  graphics_unit::world = 0, graphics_unit::display = 1, graphics_unit::pixel = 2, graphics_unit::point = 3,
  graphics_unit::inch = 4, graphics_unit::document = 5, graphics_unit::millimeter = 6
}
 Specifies the unit of measure for the given data. This enumeration has a flags attribute that allows a bitwise combination of its member values. More...
 
enum  hotkey_prefix { hotkey_prefix::none = 0, hotkey_prefix::show = 1, hotkey_prefix::hide = 2 }
 Specifies the type of display for hot-key prefixes that relate to text. More...
 
enum  known_color {
  known_color::active_border = 1, known_color::active_caption, known_color::active_caption_text, known_color::app_workspace,
  known_color::control, known_color::control_dark, known_color::control_dark_dark, known_color::control_light,
  known_color::control_light_light, known_color::control_text, known_color::desktop, known_color::gray_text,
  known_color::highlight, known_color::highlight_text, known_color::hot_track, known_color::inactive_border,
  known_color::inactive_caption, known_color::inactive_caption_text, known_color::info, known_color::info_text,
  known_color::menu, known_color::menu_text, known_color::scroll_bar, known_color::window,
  known_color::window_frame, known_color::window_text, known_color::transparent, known_color::alice_blue,
  known_color::antique_white, known_color::aqua, known_color::aquamarine, known_color::azure,
  known_color::beige, known_color::bisque, known_color::black, known_color::blanched_almond,
  known_color::blue, known_color::blue_violet, known_color::brown, known_color::burly_wood,
  known_color::cadet_blue, known_color::chartreuse, known_color::chocolate, known_color::coral,
  known_color::cornflower_blue, known_color::cornsilk, known_color::crimson, known_color::cyan,
  known_color::dark_blue, known_color::dark_cyan, known_color::dark_goldenrod, known_color::dark_gray,
  known_color::dark_green, known_color::dark_khaki, known_color::dark_magenta, known_color::dark_olive_green,
  known_color::dark_orange, known_color::dark_orchid, known_color::dark_red, known_color::dark_salmon,
  known_color::dark_sea_green, known_color::dark_slate_blue, known_color::dark_slate_gray, known_color::dark_turquoise,
  known_color::dark_violet, known_color::deep_pink, known_color::deep_sky_blue, known_color::dim_gray,
  known_color::dodger_blue, known_color::firebrick, known_color::floral_white, known_color::forest_green,
  known_color::fuchsia, known_color::gainsboro, known_color::ghost_white, known_color::gold,
  known_color::goldenrod, known_color::gray, known_color::green, known_color::green_yellow,
  known_color::honeydew, known_color::hot_pink, known_color::indian_red, known_color::indigo,
  known_color::ivory, known_color::khaki, known_color::lavender, known_color::lavender_blush,
  known_color::lawn_green, known_color::lemon_chiffon, known_color::light_blue, known_color::light_coral,
  known_color::light_cyan, known_color::light_goldenrod_yellow, known_color::light_gray, known_color::light_green,
  known_color::light_pink, known_color::light_salmon, known_color::light_sea_green, known_color::light_sky_blue,
  known_color::light_slate_gray, known_color::light_steel_blue, known_color::light_yellow, known_color::lime,
  known_color::lime_green, known_color::linen, known_color::magenta, known_color::maroon,
  known_color::medium_aquamarine, known_color::medium_blue, known_color::medium_orchid, known_color::medium_purple,
  known_color::medium_sea_green, known_color::medium_slate_blue, known_color::medium_spring_green, known_color::medium_turquoise,
  known_color::medium_violet_red, known_color::midnight_blue, known_color::mint_cream, known_color::misty_rose,
  known_color::moccasin, known_color::navajo_white, known_color::navy, known_color::old_lace,
  known_color::olive, known_color::olive_drab, known_color::orange, known_color::orange_red,
  known_color::orchid, known_color::pale_goldenrod, known_color::pale_green, known_color::pale_turquoise,
  known_color::pale_violet_red, known_color::papaya_whip, known_color::peach_puff, known_color::peru,
  known_color::pink, known_color::plum, known_color::powder_blue, known_color::purple,
  known_color::rebecca_purple, known_color::red, known_color::rosy_brown, known_color::royal_blue,
  known_color::saddle_brown, known_color::salmon, known_color::sandy_brown, known_color::sea_green,
  known_color::sea_shell, known_color::sienna, known_color::silver, known_color::sky_blue,
  known_color::slate_blue, known_color::slate_gray, known_color::snow, known_color::spring_green,
  known_color::steel_blue, known_color::tan, known_color::teal, known_color::thistle,
  known_color::tomato, known_color::turquoise, known_color::violet, known_color::wheat,
  known_color::white, known_color::white_smoke, known_color::yellow, known_color::yellow_green,
  known_color::button_face, known_color::button_highlight, known_color::button_shadow, known_color::gradient_active_caption,
  known_color::gradient_inactive_caption, known_color::menu_bar, known_color::menu_highlight, known_color::accent,
  known_color::accent_text, known_color::text_box, known_color::text_box_text
}
 Specifies the known system colors. More...
 
enum  string_alignment { string_alignment::near = 0, string_alignment::center = 1, string_alignment::far = 2 }
 Specifies the alignment of a text string relative to its layout rectangle. More...
 
enum  string_format_flags {
  string_format_flags::direction_right_to_left = 0b1, string_format_flags::direction_vertical = 0b10, string_format_flags::fit_black_box = 0b100, string_format_flags::display_format_control = 0b100000,
  string_format_flags::no_font_fallback = 0b10000000000, string_format_flags::measure_trailing_spaces = 0b100000000000, string_format_flags::no_wrap = 0b1000000000000, string_format_flags::line_limit = 0b10000000000000,
  string_format_flags::no_clip = 0b100000000000000
}
 Specifies the display and layout information for text strings. This enumeration allows a bitwise combination of its member values. More...
 
enum  string_trimming {
  string_trimming::none = 0, string_trimming::character = 1, string_trimming::word = 2, string_trimming::ellipsis_character = 3,
  string_trimming::ellipsis_word = 4, string_trimming::ellipsis_path = 5
}
 Specifies how to trim characters from a string that does not completely fit into a layout shape. More...
 

Detailed Description

The xtd::drawing namespace provides access to GDI+ basic graphics functionality. More advanced functionality is provided in the xtd::drawing::drawing_2d, xtd::drawing::imaging, and xtd::drawing::text namespaces.

Enumeration Type Documentation

§ dash_style

Specifies the style of dashed lines drawn with a xtd::drawing::pen object.

Remarks
To define a custom dash_style, set the dash_pattern property of the xtd::drawing::pen.
Enumerator
solid 

Specifies a solid line.

dash 

Specifies a line consisting of dashes.

dot 

Specifies a line consisting of dots.

dash_dot 

Specifies a line consisting of a repeating pattern of dash-dot.

dash_dot_dot 

Specifies a line consisting of a repeating pattern of dash-dot-dot.

custom 

Specifies a user-defined custom dash style.

§ font_style

Specifies style information applied to text. This enumeration has a flags attribute that allows a bitwise combination of its member values.

Enumerator
regular 

Normal text.

bold 

Bold text.

italic 

Italic text.

underline 

Underline text.

strikeout 

Text with a line through the middle.

§ graphics_unit

Specifies the unit of measure for the given data. This enumeration has a flags attribute that allows a bitwise combination of its member values.

Enumerator
world 

Specifies the world coordinate system unit as the unit of measure.

display 

Specifies 1/75 inch as the unit of measure.

pixel 

Specifies a device pixel as the unit of measure.

point 

Specifies a printer's point (1/72 inch) as the unit of measure.

inch 

Specifies the inch as the unit of measure.

document 

Specifes the document unit (1/300 inch) as the unit of measure.

millimeter 

Specifies the millimeter as the unit of measure.

§ hotkey_prefix

Specifies the type of display for hot-key prefixes that relate to text.

Remarks
A hot-key prefix allows you to use a keyboard combination (usually CTRL+HotKey or ALT+HotKey) to access functionality represented by text displayed on the screen.
Enumerator
none 

No hot-key prefix.

show 

Display the hot-key prefix.

hide 

Do not display the hot-key prefix.

§ known_color

Specifies the known system colors.

See also
xtd::drawing::color
Enumerator
active_border 

The system-defined color of the active window's border.

active_caption 

The system-defined color of the background of the active window's title bar.

active_caption_text 

The system-defined color of the text in the active window's title bar.

app_workspace 

The system-defined color of the application workspace. The application workspace is the area in a multiple-document view that is not being occupied by documents.

control 

The system-defined face color of a 3-D element.

control_dark 

The system-defined shadow color of a 3-D element. The shadow color is applied to parts of a 3-D element that face away from the light source.

control_dark_dark 

The system-defined color that is the dark shadow color of a 3-D element. The dark shadow color is applied to the parts of a 3-D element that are the darkest color.

control_light 

The system-defined color that is the light color of a 3-D element. The light color is applied to parts of a 3-D element that face the light source.

control_light_light 

The system-defined highlight color of a 3-D element. The highlight color is applied to the parts of a 3-D element that are the lightest color.

control_text 

The system-defined color of text in a 3-D element.

desktop 

The system-defined color of the desktop.

gray_text 

The system-defined color of dimmed text. Items in a list that are disabled are displayed in dimmed text.

highlight 

The system-defined color of the background of selected items. This includes selected menu items as well as selected text.

highlight_text 

The system-defined color of the text of selected items.

hot_track 

The system-defined color used to designate a hot-tracked item. Single-clicking a hot-tracked item executes the item.

inactive_border 

The system-defined color of an inactive window's border.

inactive_caption 

The system-defined color of the background of an inactive window's title bar.

inactive_caption_text 

The system-defined color of the text in an inactive window's title bar.

info 

The system-defined color of the background of a ToolTip.

info_text 

The system-defined color of the text of a ToolTip.

menu 

The system-defined color of a menu's background.

menu_text 

The system-defined color of a menu's text.

scroll_bar 

The system-defined color of the background of a scroll bar.

window 

The system-defined color of the background in the client area of a window.

window_frame 

The system-defined color of a window frame.

window_text 

The system-defined color of the text in the client area of a window.

transparent 

A system-defined color.

alice_blue 

A system-defined color.

antique_white 

A system-defined color.

aqua 

A system-defined color.

aquamarine 

A system-defined color.

azure 

A system-defined color.

beige 

A system-defined color.

bisque 

A system-defined color.

black 

A system-defined color.

blanched_almond 

A system-defined color.

blue 

A system-defined color.

blue_violet 

A system-defined color.

brown 

A system-defined color.

burly_wood 

A system-defined color.

cadet_blue 

A system-defined color.

chartreuse 

A system-defined color.

chocolate 

A system-defined color.

coral 

A system-defined color.

cornflower_blue 

A system-defined color.

cornsilk 

A system-defined color.

crimson 

A system-defined color.

cyan 

A system-defined color.

dark_blue 

A system-defined color.

dark_cyan 

A system-defined color.

dark_goldenrod 

A system-defined color.

dark_gray 

A system-defined color.

dark_green 

A system-defined color.

dark_khaki 

A system-defined color.

dark_magenta 

A system-defined color.

dark_olive_green 

A system-defined color.

dark_orange 

A system-defined color.

dark_orchid 

A system-defined color.

dark_red 

A system-defined color.

dark_salmon 

A system-defined color.

dark_sea_green 

A system-defined color.

dark_slate_blue 

A system-defined color.

dark_slate_gray 

A system-defined color.

dark_turquoise 

A system-defined color.

dark_violet 

A system-defined color.

deep_pink 

A system-defined color.

deep_sky_blue 

A system-defined color.

dim_gray 

A system-defined color.

dodger_blue 

A system-defined color.

firebrick 

A system-defined color.

floral_white 

A system-defined color.

forest_green 

A system-defined color.

fuchsia 

A system-defined color.

gainsboro 

A system-defined color.

ghost_white 

A system-defined color.

gold 

A system-defined color.

goldenrod 

A system-defined color.

gray 

A system-defined color.

green 

A system-defined color.

green_yellow 

A system-defined color.

honeydew 

A system-defined color.

hot_pink 

A system-defined color.

indian_red 

A system-defined color.

indigo 

A system-defined color.

ivory 

A system-defined color.

khaki 

A system-defined color.

lavender 

A system-defined color.

lavender_blush 

A system-defined color.

lawn_green 

A system-defined color.

lemon_chiffon 

A system-defined color.

light_blue 

A system-defined color.

light_coral 

A system-defined color.

light_cyan 

A system-defined color.

light_goldenrod_yellow 

A system-defined color.

light_gray 

A system-defined color.

light_green 

A system-defined color.

light_pink 

A system-defined color.

light_salmon 

A system-defined color.

light_sea_green 

A system-defined color.

light_sky_blue 

A system-defined color.

light_slate_gray 

A system-defined color.

light_steel_blue 

A system-defined color.

light_yellow 

A system-defined color.

lime 

A system-defined color.

lime_green 

A system-defined color.

linen 

A system-defined color.

magenta 

A system-defined color.

maroon 

A system-defined color.

medium_aquamarine 

A system-defined color.

medium_blue 

A system-defined color.

medium_orchid 

A system-defined color.

medium_purple 

A system-defined color.

medium_sea_green 

A system-defined color.

medium_slate_blue 

A system-defined color.

medium_spring_green 

A system-defined color.

medium_turquoise 

A system-defined color.

medium_violet_red 

A system-defined color.

midnight_blue 

A system-defined color.

mint_cream 

A system-defined color.

misty_rose 

A system-defined color.

moccasin 

A system-defined color.

navajo_white 

A system-defined color.

navy 

A system-defined color.

old_lace 

A system-defined color.

olive 

A system-defined color.

olive_drab 

A system-defined color.

orange 

A system-defined color.

orange_red 

A system-defined color.

orchid 

A system-defined color.

pale_goldenrod 

A system-defined color.

pale_green 

A system-defined color.

pale_turquoise 

A system-defined color.

pale_violet_red 

A system-defined color.

papaya_whip 

A system-defined color.

peach_puff 

A system-defined color.

peru 

A system-defined color.

pink 

A system-defined color.

plum 

A system-defined color.

powder_blue 

A system-defined color.

purple 

A system-defined color.

rebecca_purple 

A system-defined color.

red 

A system-defined color.

rosy_brown 

A system-defined color.

royal_blue 

A system-defined color.

saddle_brown 

A system-defined color.

salmon 

A system-defined color.

sandy_brown 

A system-defined color.

sea_green 

A system-defined color.

sea_shell 

A system-defined color.

sienna 

A system-defined color.

silver 

A system-defined color.

sky_blue 

A system-defined color.

slate_blue 

A system-defined color.

slate_gray 

A system-defined color.

snow 

A system-defined color.

spring_green 

A system-defined color.

steel_blue 

A system-defined color.

tan 

A system-defined color.

teal 

A system-defined color.

thistle 

A system-defined color.

tomato 

A system-defined color.

turquoise 

A system-defined color.

violet 

A system-defined color.

wheat 

A system-defined color.

white 

A system-defined color.

white_smoke 

A system-defined color.

yellow 

A system-defined color.

yellow_green 

A system-defined color.

button_face 

The system-defined face color of a 3-D element.

button_highlight 

The system-defined color that is the highlight color of a 3-D element. This color is applied to parts of a 3-D element that face the light source.

button_shadow 

The system-defined color that is the shadow color of a 3-D element. This color is applied to parts of a 3-D element that face away from the light source.

gradient_active_caption 

The system-defined color of the lightest color in the color gradient of an active window's title bar.

gradient_inactive_caption 

The system-defined color of the lightest color in the color gradient of an inactive window's title bar.

menu_bar 

The system-defined color of the background of a menu bar.

menu_highlight 

The system-defined color used to highlight menu items when the menu appears as a flat menu.

accent 

The system-defined color of the accent color (macos specific. On other platform is same as menu_highlight).

accent_text 

The system-defined color of the accent text color (macos specific. On other platform is same as highlight_text).

text_box 

The system-defined color of the accent color (macos specific. On other platform is same as window).

text_box_text 

The system-defined color of the accent text color (macos specific. On other platform is same as window_text).

§ string_alignment

Specifies the alignment of a text string relative to its layout rectangle.

Remarks
When used with the line_alignment property, this enumeration sets the vertical alignment for a drawn string. When used with the alignment property, this enumeration sets the horizontal alignment.
Enumerator
near 

Specifies the text be aligned near the layout. In a left-to-right layout, the near position is left. In a right-to-left layout, the near position is right.

center 

Specifies that text is aligned in the center of the layout rectangle.

far 

Specifies that text is aligned far from the origin position of the layout rectangle. In a left-to-right layout, the far position is right. In a right-to-left layout, the far position is left.

§ string_format_flags

Specifies the display and layout information for text strings. This enumeration allows a bitwise combination of its member values.

Enumerator
direction_right_to_left 

Text is displayed from right to left. text.

direction_vertical 

Text is vertically aligned.

fit_black_box 

Parts of characters are allowed to overhang the string's layout rectangle. By default, characters are repositioned to avoid any overhang.

display_format_control 

Control characters such as the left-to-right mark are shown in the output with a representative glyph.

no_font_fallback 

Fallback to alternate fonts for characters not supported in the requested font is disabled. Any missing characters are displayed with the fonts missing glyph, usually an open square.

measure_trailing_spaces 

Includes the trailing space at the end of each line. By default the boundary rectangle returned by the MeasureString method excludes the space at the end of each line. Set this flag to include that space in measurement.

no_wrap 

Text wrapping between lines when formatting within a rectangle is disabled. This flag is implied when a point is passed instead of a rectangle, or when the specified rectangle has a zero line length.

line_limit 

Only entire lines are laid out in the formatting rectangle. By default layout continues until the end of the text, or until no more lines are visible as a result of clipping, whichever comes first. Note that the default settings allow the last line to be partially obscured by a formatting rectangle that is not a whole multiple of the line height. To ensure that only whole lines are seen, specify this value and be careful to provide a formatting rectangle at least as tall as the height of one line.

no_clip 

Overhanging parts of glyphs, and unwrapped text reaching outside the formatting rectangle are allowed to show. By default all text and glyph parts reaching outside the formatting rectangle are clipped.

§ string_trimming

Specifies how to trim characters from a string that does not completely fit into a layout shape.

Enumerator
none 

Specifies no trimming.

character 

Specifies that the text is trimmed to the nearest character.

word 

Specifies that text is trimmed to the nearest word.

ellipsis_character 

Specifies that the text is trimmed to the nearest character, and an ellipsis is inserted at the end of a trimmed line.

ellipsis_word 

Specifies that text is trimmed to the nearest word, and an ellipsis is inserted at the end of a trimmed line.

ellipsis_path 

The center is removed from trimmed lines and replaced by an ellipsis. The algorithm keeps as much of the last slash-delimited segment of the line as possible.