xtd 0.2.0
linear_gradient_brush.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "../../drawing_export.hpp"
6#include "../brush.hpp"
7#include "../color.hpp"
8#include "../point.hpp"
9#include "../rectangle.hpp"
12#include <array>
13#include <utility>
14
16namespace xtd {
18 namespace drawing {
20 namespace drawing_2d {
32 struct data;
33
34 public:
36
64 linear_gradient_brush(const xtd::drawing::rectangle& rect, const xtd::drawing::color& color1, const xtd::drawing::color& color2, float angle);
76 linear_gradient_brush(const xtd::drawing::rectangle_f& rect, const xtd::drawing::color& color1, const xtd::drawing::color& color2, float angle);
92 linear_gradient_brush(const xtd::drawing::point& point1, const xtd::drawing::point& point2, const std::vector<xtd::drawing::color>& linear_colors);
98 linear_gradient_brush(const xtd::drawing::point_f& point1, const xtd::drawing::point_f& point2, const std::vector<xtd::drawing::color>& linear_colors);
110 linear_gradient_brush(const xtd::drawing::rectangle& rect, const std::vector<xtd::drawing::color>& linear_colors, float angle);
122 linear_gradient_brush(const xtd::drawing::rectangle_f& rect, const std::vector<xtd::drawing::color>& linear_colors, float angle);
127 linear_gradient_brush(const xtd::drawing::rectangle& rect, const std::vector<xtd::drawing::color>& linear_colors);
132 linear_gradient_brush(const xtd::drawing::rectangle_f& rect, const std::vector<xtd::drawing::color>& linear_colors);
134
137 linear_gradient_brush& operator =(const linear_gradient_brush& value);
139
141
145 float angle() const noexcept;
149 linear_gradient_brush& angle(float value) noexcept;
150
153 const xtd::drawing::drawing_2d::gradient_stop_collection& linear_colors() const noexcept;
157 xtd::drawing::drawing_2d::linear_gradient_brush& linear_colors(const xtd::drawing::drawing_2d::gradient_stop_collection& value);
158
161 const xtd::drawing::rectangle_f& rectangle() const noexcept;
165 linear_gradient_brush& rectangle(const xtd::drawing::rectangle_f& value) noexcept;
169 linear_gradient_brush& rectangle(const xtd::drawing::rectangle& value) noexcept;
171
172 private:
173 static float linear_gradient_mode_to_angle(xtd::drawing::drawing_2d::linear_gradient_mode);
174 void recreate_handle();
175
176 xtd::sptr<data> data_;
177 };
178 }
179
182 namespace [[deprecated("Replaced by xtd::drawing::drawing_2d - Will be removed in version 0.4.0.")]] drawing2d {
185 using linear_gradient_brush [[deprecated("Replaced by xtd::drawing::drawing_2d::linear_gradient_brush - Will be removed in version 0.4.0.")]] = xtd::drawing::drawing_2d::linear_gradient_brush;
186 }
187 }
188}
189
Represents a strongly typed list of objects that can be accessed by index. Provides methods to search...
Definition list.hpp:80
Defines objects used to fill the interiors of graphical shapes such as rectangles,...
Definition brush.hpp:33
Represents an ARGB (alpha, red, green, blue) color.
Definition color.hpp:49
Encapsulates a xtd::drawing::brush with a linear gradient. This class cannot be inherited.
Definition linear_gradient_brush.hpp:31
linear_gradient_brush(const xtd::drawing::rectangle &rect, const std::vector< xtd::drawing::color > &linear_colors)
Initializes a new instance of the linear_gradient_brush class with the specified rectangle and colors...
linear_gradient_brush(const xtd::drawing::point &point1, const xtd::drawing::point &point2, const std::vector< xtd::drawing::color > &linear_colors)
Initializes a new instance of the linear_gradient_brush class with the specified points and colors.
linear_gradient_brush(const xtd::drawing::point &point1, const xtd::drawing::point &point2, const xtd::drawing::color &color1, const xtd::drawing::color &color2)
Initializes a new instance of the linear_gradient_brush class with the specified points and colors.
linear_gradient_brush(const xtd::drawing::rectangle_f &rect, const xtd::drawing::color &color1, const xtd::drawing::color &color2, xtd::drawing::drawing_2d::linear_gradient_mode linear_gradient_mode)
Initializes a new instance of the linear_gradient_brush class with the specified rectangle,...
linear_gradient_brush(const xtd::drawing::rectangle_f &rect, const std::vector< xtd::drawing::color > &linear_colors, float angle)
Initializes a new instance of the linear_gradient_brush class with the specified rectangle,...
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)
Initializes a new instance of the linear_gradient_brush class with the specified rectangle,...
linear_gradient_brush(const xtd::drawing::rectangle_f &rect, const xtd::drawing::color &color1, const xtd::drawing::color &color2)
Initializes a new instance of the linear_gradient_brush class with the specified rectangle and colors...
linear_gradient_brush(const xtd::drawing::point_f &point1, const xtd::drawing::point_f &point2, const std::vector< xtd::drawing::color > &linear_colors)
Initializes a new instance of the linear_gradient_brush class with the specified points and colors.
linear_gradient_brush(const xtd::drawing::rectangle &rect, const xtd::drawing::color &color1, const xtd::drawing::color &color2)
Initializes a new instance of the linear_gradient_brush class with the specified rectangle and colors...
linear_gradient_brush(const xtd::drawing::rectangle &rect, const xtd::drawing::color &color1, const xtd::drawing::color &color2, xtd::drawing::drawing_2d::linear_gradient_mode linear_gradient_mode)
Initializes a new instance of the linear_gradient_brush class with the specified rectangle,...
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)
Initializes a new instance of the linear_gradient_brush class with the specified points and colors.
float angle() const noexcept
Gets the angle of the gradient.
linear_gradient_brush(const xtd::drawing::rectangle &rect, const std::vector< xtd::drawing::color > &linear_colors, float angle)
Initializes a new instance of the linear_gradient_brush class with the specified rectangle,...
linear_gradient_brush(const xtd::drawing::rectangle_f &rect, const std::vector< xtd::drawing::color > &linear_colors)
Initializes a new instance of the linear_gradient_brush class with the specified rectangle and colors...
linear_gradient_brush(const xtd::drawing::rectangle &rect, const xtd::drawing::color &color1, const xtd::drawing::color &color2, float angle)
Initializes a new instance of the linear_gradient_brush class with the specified rectangle,...
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)
Initializes a new instance of the linear_gradient_brush class with the specified rectangle,...
linear_gradient_brush(const xtd::drawing::rectangle_f &rect, const xtd::drawing::color &color1, const xtd::drawing::color &color2, float angle)
Initializes a new instance of the linear_gradient_brush class with the specified rectangle,...
linear_gradient_brush()
Initializes a new instance of the xtd::drawing::drawing_2d::radial_gradient_brush class with default ...
Represents the version number of an assembly, operating system, or the xtd. This class cannot be inhe...
Definition version.hpp:114
Contains xtd::drawing::drawing_2d::gradient_stop alias.
#define drawing_export_
Define shared library export.
Definition drawing_export.hpp:13
std::shared_ptr< type_t > sptr
The xtd::sptr object is a shared pointer.
Definition sptr.hpp:25
linear_gradient_mode
Specifies the direction of a linear gradient.
Definition linear_gradient_mode.hpp:19
Contains xtd::drawing::drawing_2d::linear_gradient_mode enum class.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10
Represents an ordered pair of floating-point x- and y-coordinates that defines a point in a two-dimen...
Definition point_f.hpp:35
Represents an ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional ...
Definition point.hpp:54
Stores a set of four floating-point numbers that represent the location and size of a rectangle....
Definition rectangle_f.hpp:34
Stores a set of four integers that represent the location and size of a rectangle.
Definition rectangle.hpp:44