#include <xtd/forms/application>
#include <xtd/forms/form>
#include <xtd/forms/images>
#include <xtd/math>
class form_main :
public form {
public:
form_main() {
text(
"Draw image example");
}
protected:
auto image_size =
math::min(
e.clip_rectangle().width,
e.clip_rectangle().height);
auto image_rect =
rectangle((
e.clip_rectangle().width - image_size) / 2, (
e.clip_rectangle().height - image_size) / 2, image_size, image_size);
e.graphics().draw_image(
image, image_rect);
}
private:
};
auto main() -> int {
}
An abstract base class that provides functionality for the bitmap and metafile descended classes.
Definition image.hpp:49
static xtd::byte min(xtd::byte a, xtd::byte b) noexcept
Returns the smaller of two 8-bit unsigned integers.
@ e
The E key.
Definition console_key.hpp:96
The xtd::drawing namespace provides access to GDI+ basic graphics functionality. More advanced functi...
Definition actions_system_images.hpp:10
Contains classes that represent ASCII and Unicode character encodings; abstract base classes for conv...
Definition basic_string_builder.hpp:16
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
Stores a set of four integers that represent the location and size of a rectangle.
Definition rectangle.hpp:44
Stores an ordered pair of integers, which specify a height and width.
Definition size.hpp:31