xtd 0.2.0
Loading...
Searching...
No Matches
linear_gradient_brush.h
Go to the documentation of this file.
1
4#pragma once
5#include "../../drawing_export.h"
6#include "../brush.h"
7#include "../color.h"
8#include "../point.h"
9#include "../rectangle.h"
12#include <array>
13#include <utility>
14
16namespace xtd {
18 namespace drawing {
20 namespace drawing_2d {
31 class drawing_export_ linear_gradient_brush final : public brush, xtd::iequatable<linear_gradient_brush> {
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
173
175 using brush::equals;
176 bool equals(const linear_gradient_brush& value) const noexcept override;
178
179 private:
180 static float linear_gradient_mode_to_angle(xtd::drawing::drawing_2d::linear_gradient_mode);
181 void recreate_handle();
182
183 xtd::sptr<data> data_;
184 };
185 }
186
189 namespace [[deprecated("Replaced by xtd::drawing::drawing_2d - Will be removed in version 0.4.0.")]] drawing2d {
192 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;
193 }
194 }
195}
196
Defines objects used to fill the interiors of graphical shapes such as rectangles,...
Definition brush.h:33
Represents an ARGB (alpha, red, green, blue) color.
Definition color.h:49
Encapsulates a xtd::drawing::brush with a linear gradient. This class cannot be inherited.
Definition linear_gradient_brush.h: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 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 ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional ...
Definition point.h:54
Stores a set of four floating-point numbers that represent the location and size of a rectangle....
Definition rectangle_f.h:34
Stores a set of four integers that represent the location and size of a rectangle.
Definition rectangle.h:44
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.h:22
Represents the version number of an assembly, operating system, or the xtd. This class cannot be inhe...
Definition version.h:114
Contains xtd::drawing::drawing_2d::linear_gradient_mode enum class.
Contains xtd::drawing::drawing_2d::gradient_stop alias.
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 a...
Definition gradient_stop_collection.h:20
#define drawing_export_
Define shared library export.
Definition drawing_export.h:13
std::shared_ptr< type_t > sptr
The xtd::sptr object is a shared pointer.
Definition sptr.h:25
linear_gradient_mode
Specifies the direction of a linear gradient.
Definition linear_gradient_mode.h:19
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10