The classic first application "Hello, World!" with GDI+ drawing objects.
#include <xtd/xtd>
namespace hello_world_paint_example {
class main_form :
public form {
public:
main_form() {
text("Hello world (paint)");
client_size({300, 300});
e.graphics().clear(color::light_blue);
e.graphics().draw_string(
"Hello, World!", {system_fonts::default_font(), 32, font_style::bold | font_style::italic},
solid_brush {color_converter::dark(color::light_blue)}, rectangle::offset(e.clip_rectangle(), {2, 2}),
string_format().
alignment(string_alignment::center).line_alignment(string_alignment::center));
e.graphics().draw_string(
"Hello, World!", {system_fonts::default_font(), 32, font_style::bold | font_style::italic}, brushes::dark_blue(), rectangle::inflate(e.clip_rectangle(), {-2, -2}),
string_format().
alignment(string_alignment::center).line_alignment(string_alignment::center));
};
}
};
}
auto main() -> int {
application::run(hello_world_paint_example::main_form());
}
Defines a xtd::drawing::brush of a single color. Brushes are used to fill graphics shapes,...
Definition solid_brush.h:30
The xtd::drawing namespace provides access to GDI+ basic graphics functionality. More advanced functi...
Definition brush.h:18
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10