xtd 0.2.0
linear_gradient_brush.h
Go to the documentation of this file.
1 #pragma once
5 #include "../../drawing_export.h"
6 #include "../brush.h"
7 #include "../color.h"
8 #include "../point.h"
9 #include "../rectangle.h"
10 #include "drawing2d.h"
12 #include "linear_gradient_mode.h"
13 #include <array>
14 #include <utility>
15 
17 namespace xtd {
19  namespace drawing {
21  namespace drawing_2d {
32  class drawing_export_ linear_gradient_brush final : public brush, xtd::iequatable<linear_gradient_brush> {
33  struct data;
34 
35  public:
37 
47  linear_gradient_brush(const xtd::drawing::point& point1, const xtd::drawing::point& point2, const xtd::drawing::color& color1, const xtd::drawing::color& color2);
53  linear_gradient_brush(const xtd::drawing::point_f& point1, const xtd::drawing::point_f& point2, const xtd::drawing::color& color1, const xtd::drawing::color& color2);
65  linear_gradient_brush(const xtd::drawing::rectangle& rect, const xtd::drawing::color& color1, const xtd::drawing::color& color2, float angle);
77  linear_gradient_brush(const xtd::drawing::rectangle_f& rect, const xtd::drawing::color& color1, const xtd::drawing::color& color2, float angle);
93  linear_gradient_brush(const xtd::drawing::point& point1, const xtd::drawing::point& point2, const std::vector<xtd::drawing::color>& linear_colors);
99  linear_gradient_brush(const xtd::drawing::point_f& point1, const xtd::drawing::point_f& point2, const std::vector<xtd::drawing::color>& linear_colors);
105  linear_gradient_brush(const xtd::drawing::rectangle& rect, const std::vector<xtd::drawing::color>& linear_colors, xtd::drawing::drawing_2d::linear_gradient_mode linear_gradient_mode);
111  linear_gradient_brush(const xtd::drawing::rectangle& rect, const std::vector<xtd::drawing::color>& linear_colors, float angle);
117  linear_gradient_brush(const xtd::drawing::rectangle_f& rect, const std::vector<xtd::drawing::color>& linear_colors, xtd::drawing::drawing_2d::linear_gradient_mode linear_gradient_mode);
123  linear_gradient_brush(const xtd::drawing::rectangle_f& rect, const std::vector<xtd::drawing::color>& linear_colors, float angle);
128  linear_gradient_brush(const xtd::drawing::rectangle& rect, const std::vector<xtd::drawing::color>& linear_colors);
133  linear_gradient_brush(const xtd::drawing::rectangle_f& rect, const std::vector<xtd::drawing::color>& linear_colors);
135 
138  linear_gradient_brush& operator =(const linear_gradient_brush& value);
140 
142 
146  float angle() const noexcept;
150  linear_gradient_brush& angle(float value) noexcept;
151 
154  const xtd::drawing::drawing_2d::gradient_stop_collection& linear_colors() const noexcept;
159 
162  const xtd::drawing::rectangle_f& rectangle() const noexcept;
172 
174 
176  using brush::equals;
177  bool equals(const linear_gradient_brush& value) const noexcept override;
179 
180  private:
181  static float linear_gradient_mode_to_angle(xtd::drawing::drawing_2d::linear_gradient_mode);
182  void recreate_handle();
183 
184  std::shared_ptr<data> data_;
185  };
186  }
187  }
188 }
189 
Encapsulates a xtd::drawing::brush with a linear gradient. This class cannot be inherited.
Definition: linear_gradient_brush.h:32
Contains xtd::drawing::drawing_2d/::linear_gradient_mode enum class.
Represents an ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional ...
Definition: point.h:54
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
Stores a set of four floating-point numbers that represent the location and size of a rectangle...
Definition: rectangle_f.h:34
Represents an ordered pair of floating-point x- and y-coordinates that defines a point in a two-dimen...
Definition: point_f.h:35
Represents an ARGB (alpha, red, green, blue) color.
Definition: color.h:45
std::vector< xtd::drawing::drawing_2d::gradient_stop > gradient_stop_collection
Represents a collection of xtd::drawing::drawing_2d/gradient_stop objects that can be individually ac...
Definition: gradient_stop_collection.h:21
Contains xtd::drawing::drawing_2d/::gradient_stop alias.
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition: iequatable.h:18
Stores a set of four integers that represent the location and size of a rectangle.
Definition: rectangle.h:44
linear_gradient_mode
Specifies the direction of a linear gradient.
Definition: linear_gradient_mode.h:20
Contains xtd::drawing::drawing_2d/::matrix class.
Defines objects used to fill the interiors of graphical shapes such as rectangles, ellipses, pies, polygons, and paths.
Definition: brush.h:33