#include <xtd/diagnostics/process>
#include <xtd/drawing/drawing_2d/linear_gradient_brush>
#include <xtd/drawing/drawing_2d/radial_gradient_brush>
#include <xtd/drawing/bitmap>
#include <xtd/drawing/brushes>
#include <xtd/drawing/graphics>
#include <xtd/drawing/system_fonts>
#include <xtd/io/path>
auto main() -> int {
auto drawing_bitmap =
bitmap {640, 480};
graphics.
draw_string(
"Drawing with graphics",
drawing::font(
"Arial", 34,
font_style::regular),
drawing_2d::linear_gradient_brush(
rectangle_f {20.0f, 20.0f, drawing_bitmap.width() - 180.0f, drawing_bitmap.height() - 40.0f},
color::navy,
color::light_blue), {20.0f, 20.0f, drawing_bitmap.width() - 180.0f, drawing_bitmap.height() - 40.0f});
graphics.
fill_polygon(
linear_gradient_brush {
rectangle {drawing_bitmap.width() / 2 - 160, drawing_bitmap.height() - 300, 320, 120},
color::brown,
color::sandy_brown,
linear_gradient_mode::backward_diagonal},
list<point> {{drawing_bitmap.width() / 2, drawing_bitmap.height() - 300}, {drawing_bitmap.width() / 2 + 160, drawing_bitmap.height() - 180}, {drawing_bitmap.width() / 2 - 160, drawing_bitmap.height() - 180},});
}
Represents a strongly typed list of objects that can be accessed by index. Provides methods to search...
Definition list.hpp:79
bool start()
Starts (or reuses) the process resource that is specified by the xtd::diagnostics::process::start_inf...
Encapsulates a GDI+ bitmap, which consists of the pixel data for a graphics image and its attributes....
Definition bitmap.hpp:26
static xtd::drawing::solid_brush white()
A system-defined brush object.
static xtd::drawing::solid_brush spring_green()
A system-defined brush object.
static xtd::drawing::solid_brush black()
A system-defined brush object.
static xtd::drawing::solid_brush red()
A system-defined brush object.
static const xtd::drawing::color yellow
Gets a system-defined color that has an ARGB value of 0xFFFFFF00. This field is constant.
Definition color.hpp:476
static const xtd::drawing::color white
Gets a system-defined color that has an ARGB value of 0xFFFFFFFF. This field is constant.
Definition color.hpp:470
static const xtd::drawing::color light_blue
Gets a system-defined color that has an ARGB value of 0xFFADD8E6. This field is constant.
Definition color.hpp:248
static const xtd::drawing::color yellow_green
Gets a system-defined color that has an ARGB value of 0xFF9ACD32. This field is constant.
Definition color.hpp:479
static const xtd::drawing::color navy
Gets a system-defined color that has an ARGB value of 0xFF000080. This field is constant.
Definition color.hpp:344
static const xtd::drawing::color sandy_brown
Gets a system-defined color that has an ARGB value of 0xFFF4A460. This field is constant.
Definition color.hpp:416
static const xtd::drawing::color brown
Gets a system-defined color that has an ARGB value of 0xFFA52A2A. This field is constant.
Definition color.hpp:92
static const xtd::drawing::color cyan
Gets a system-defined color that has an ARGB value of 0xFF00FFFF. This field is constant.
Definition color.hpp:119
Encapsulates a xtd::drawing::brush with a linear gradient. This class cannot be inherited.
Definition linear_gradient_brush.hpp:30
Encapsulates a xtd::drawing::brush with a radial gradient. This class cannot be inherited.
Definition radial_gradient_brush.hpp:29
Defines a particular format for text, including font face, size, and style attributes....
Definition font.hpp:45
Defines an object used to draw lines and curves. This class cannot be inherited.
Definition graphics.hpp:67
void fill_polygon(const xtd::drawing::brush &brush, const xtd::array< xtd::drawing::point > &points)
Fills the interior of a polygon defined by an array of points specified by xtd::drawing::point struct...
void clear(const color &color)
Clears the entire drawing surface and fills it with the specified background color.
void draw_string(const xtd::string &s, const xtd::drawing::font &font, const xtd::drawing::brush &brush, const xtd::drawing::rectangle_f &layout_rectangle)
Draws the specified text string at the specified rectangle with the specified xtd::drawing::brush and...
void fill_ellipse(const xtd::drawing::brush &brush, const xtd::drawing::rectangle &rect)
Fills the interior of an ellipse defined by a bounding rectangle specified by a xtd::drawing::rectang...
void fill_rectangle(const xtd::drawing::brush &brush, const xtd::drawing::rectangle &rect)
Fills the interior of a rectangle specified by a xtd::drawing::rectangle structure.
void draw_ellipse(const xtd::drawing::pen &pen, const xtd::drawing::rectangle &rect)
Draws an ellipse specified by a bounding xtd::drawing::rectangle structure.
static graphics from_image(const xtd::drawing::image &image)
Creates a new xtd::drawing::graphics from the specified xtd::drawing::image.
Defines an object used to draw lines and curves. This class cannot be inherited.
Definition pen.hpp:32
float width() const noexcept
Gets the width of this xtd::drawing::pen, in units of the xtd::drawing::graphics object used for draw...
static xtd::string get_temp_path() noexcept
Returns the path of the current user's temporary folder.
static xtd::string combine(const xtd::string &path1, const xtd::string &path2)
Combines two path strings.
@ regular
Normal text.
Definition font_style.hpp:19
@ backward_diagonal
Specifies a gradient from upper right to lower left.
Definition linear_gradient_mode.hpp:27
The xtd::collections::generic namespace contains interfaces and classes that define generic collectio...
Definition comparer.hpp:16
The xtd::diagnostics namespace provides classes that allow you to interact with system processes,...
Definition assert_dialog_result.hpp:10
The xtd::drawing::drawing_2d namespace provides advanced two-dimensional and vector graphics function...
Definition compositing_mode.hpp:12
The xtd::drawing namespace provides access to GDI+ basic graphics functionality. More advanced functi...
Definition actions_system_images.hpp:10
The xtd::io namespace contains types that allow reading and writing to files and data streams,...
Definition binary_reader.hpp:17
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
Represents an ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional ...
Definition point.hpp:54
Stores a set of four floating-point numbers that represent the location and size of a rectangle....
Definition rectangle_f.hpp:34
Stores a set of four integers that represent the location and size of a rectangle.
Definition rectangle.hpp:44