xtd - Reference Guide  0.2.0
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
Go to the documentation of this file.
1 #pragma once
5 #include <optional>
6 #include "control.h"
7 #include "border_style.h"
9 #include <xtd/drawing/image.h>
12 namespace xtd {
14  namespace forms {
24  class forms_export_ picture_box : public control {
25  public:
26  picture_box();
31  virtual forms::border_style border_style() const {return border_style_;}
38  drawing::size default_size() const override {return {100, 50};}
43  const std::optional<drawing::image> image() const {return image_;}
48  picture_box& image(const drawing::image& image);
53  picture_box& image(std::nullptr_t);
58  picture_box_size_mode size_mode() const {return size_mode_;}
63  picture_box& size_mode(picture_box_size_mode size_mode);
65  protected:
66  forms::create_params create_params() const override;
70  void on_handle_created(const event_args& e) override;
72  drawing::size measure_control() const override;
76  std::optional<drawing::image> image_;
79  };
80  }
81 }
The default appearance defined by the control class.
picture_box_size_mode size_mode() const
Indicates how the image is displayed.
Definition: picture_box.h:58
Represents the base class for classes that contain event data, and provides a value to use for events...
Definition: event_args.h:18
drawing::size default_size() const override
Gets the default size of the control.
Definition: picture_box.h:38
Stores an ordered pair of integers, which specify a height and width.
Definition: size.h:25
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
Contains xtd::drawing::image class.
Represents a standard Windows picture box.
Definition: picture_box.h:24
const std::optional< drawing::image > image() const
Gets the image that is displayed by picture_box.
Definition: picture_box.h:43
virtual forms::border_style border_style() const
Gets the border style for the control.
Definition: picture_box.h:31
Specifies the border style for a control.
Definition: border_style.h:18
An abstract base class that provides functionality for the bitmap and metafile descended classes...
Definition: image.h:34
Defines the base class for controls, which are components with visual representation.
Definition: control.h:68
Specifies how an image is positioned within a picture_box.
Definition: picture_box_size_mode.h:18
Contains xtd::forms::control control.
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition: about_box.h:13
Contains xtd::forms::picture_box_size_mode enum class.
Contains xtd::forms::border_style enum class.