xtd - Reference Guide 0.2.0
conical_gradient_brush.h
Go to the documentation of this file.
1 #pragma once
5 #include <array>
6 #include <utility>
7 #include "../../drawing_export.h"
8 #include "../brush.h"
9 #include "../point.h"
10 #include "../rectangle.h"
12 
14 namespace xtd {
16  namespace drawing {
18  namespace drawing2d {
34  class drawing_export_ conical_gradient_brush final : public brush {
35  public:
37 
51  conical_gradient_brush(const xtd::drawing::point_f& center, const xtd::drawing::color& color1, const xtd::drawing::color& color2);
57  conical_gradient_brush(const xtd::drawing::point& center, const xtd::drawing::color& color1, const xtd::drawing::color& color2, float angle);
63  conical_gradient_brush(const xtd::drawing::point_f& center, const xtd::drawing::color& color1, const xtd::drawing::color& color2, float angle);
68  conical_gradient_brush(const xtd::drawing::point& center, const std::vector<xtd::drawing::color>& conical_colors);
73  conical_gradient_brush(const xtd::drawing::point_f& center, const std::vector<xtd::drawing::color>& conical_colors);
79  conical_gradient_brush(const xtd::drawing::point& center, const std::vector<xtd::drawing::color>& conical_colors, float angle);
85  conical_gradient_brush(const xtd::drawing::point_f& center, const std::vector<xtd::drawing::color>& conical_colors, float angle);
87 
90  conical_gradient_brush& operator =(const conical_gradient_brush& value);
91  bool operator ==(const conical_gradient_brush& value) const {return data_ == value.data_;}
92  bool operator !=(const conical_gradient_brush& value) const {return !operator ==(value);}
94 
96 
101  float angle() const noexcept;
106  conical_gradient_brush& angle(float value) noexcept;
107 
110  xtd::drawing::point_f center_point() const noexcept;
114  conical_gradient_brush& center_point(const xtd::drawing::point_f& value) noexcept;
118  conical_gradient_brush& center_point(const xtd::drawing::point& value) noexcept;
119 
122  const xtd::drawing::drawing2d::gradient_stop_collection& conical_colors() const noexcept;
128 
129  private:
130  void recreate_handle();
131  struct data {
132  xtd::drawing::point_f center_point;
133  float angle = 0;
135  };
136  std::shared_ptr<data> data_ = std::make_shared<data>();
137  };
138  }
139  }
140 }
141 
Encapsulates a xtd::drawing::brush with a conical gradient. This class cannot be inherited.
Definition: conical_gradient_brush.h:34
Represents an ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional ...
Definition: point.h:53
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
std::vector< xtd::drawing::drawing2d::gradient_stop > gradient_stop_collection
Represents a collection of xtd::drawing::drawing2d::gradient_stop objects that can be individually ac...
Definition: gradient_stop_collection.h:20
Represents an ordered pair of floating-point x- and y-coordinates that defines a point in a two-dimen...
Definition: point_f.h:34
Specifies that the xtd::drawing::pen object is centered over the theoretical line.
Represents an ARGB (alpha, red, green, blue) color.
Definition: color.h:44
Contains xtd::drawing::drawing2d::gradient_stop alias.
Defines objects used to fill the interiors of graphical shapes such as rectangles, ellipses, pies, polygons, and paths.
Definition: brush.h:50