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 <array>
6 #include "../../drawing_export.h"
7 #include "../brush.h"
8 #include "../color.h"
9 #include "../image.h"
10 #include "../point.h"
11 #include "../rectangle.h"
12 #include "hatch_style.h"
15 namespace xtd {
17  namespace drawing {
19  namespace drawing2d {
31  class drawing_export_ hatch_brush final : public brush {
32  public:
37  hatch_brush(xtd::drawing::drawing2d::hatch_style hatch_style, const xtd::drawing::color& fore_color) : hatch_brush(hatch_style, fore_color, xtd::drawing::color::black) {}
45  hatch_brush(const hatch_brush& value);
46  hatch_brush& operator=(const hatch_brush& value);
47  bool operator==(const hatch_brush& value) const {return data_->hatch_style_ == value.data_->hatch_style_ && data_->fore_color_ == value.data_->fore_color_ && data_->back_color_ == value.data_->back_color_;}
48  bool operator!=(const hatch_brush& value) const {return !operator==(value);}
53  xtd::drawing::color background_color() const {return data_->back_color_;}
57  xtd::drawing::color foreground_color() const {return data_->fore_color_;}
61  xtd::drawing::drawing2d::hatch_style hatch_style() const {return data_->hatch_style_;}
63  private:
64  hatch_brush();
65  void recreate_handle();
66  struct data {
68  xtd::drawing::color fore_color_;
69  xtd::drawing::color back_color_;
70  };
71  std::shared_ptr<data> data_ = std::make_shared<data>();
72  };
73  }
74  }
75 }
xtd::drawing::color background_color() const
Gets the color of spaces between the hatch lines drawn by this hatch_brush object.
Definition: hatch_brush.h:53
Contains xtd::drawing::drawing2d::hatch_style enum class.
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
Defines a rectangular xtd::drawing::brush with a hatch style, a foreground color, and a background co...
Definition: hatch_brush.h:31
Specifies the different patterns available for xtd::drawing::drawing2d::hatch_brush objects...
Definition: hatch_style.h:19
Represents an ARGB (alpha, red, green, blue) color.
Definition: color.h:39
xtd::drawing::drawing2d::hatch_style hatch_style() const
Gets the hatch style of this hatch_brush object.
Definition: hatch_brush.h:61
xtd::drawing::color foreground_color() const
Gets the color of hatch lines drawn by this hatch_brush object.
Definition: hatch_brush.h:57
The color black.
hatch_brush(xtd::drawing::drawing2d::hatch_style hatch_style, const xtd::drawing::color &fore_color)
Initializes a new instance of the xtd::drawing::drawing2d::hatch_brush class with the specified xtd::...
Definition: hatch_brush.h:37
Defines objects used to fill the interiors of graphical shapes such as rectangles, ellipses, pies, polygons, and paths.
Definition: brush.h:27