6#include "../../drawing_export.h"
10#include "../rectangle.h"
38 data_->point1_ = point1;
39 data_->point2_ = point2;
40 data_->linear_colors_ = {color1, color2};
49 data_->point1_ = point1;
50 data_->point2_ = point2;
51 data_->linear_colors_ = {color1, color2};
65 data_->point1_ = rect.location();
70 auto x = data_->point1_.x();
71 data_->point1_.x(data_->point2_.x());
74 data_->linear_colors_ = {color1, color2};
88 data_->point1_ = rect.location();
93 auto x = data_->point1_.x();
94 data_->point1_.x(data_->point2_.x());
97 data_->linear_colors_ = {color1, color2};
104 bool operator==(
const linear_gradient_brush& value)
const {
return data_->point1_ == value.data_->point1_ && data_->point2_ == value.data_->point2_ && data_->linear_colors_[0] == value.data_->linear_colors_[0] && data_->linear_colors_[1] == value.data_->linear_colors_[1];}
105 bool operator!=(
const linear_gradient_brush& value)
const {
return !operator==(value);}
110 const std::array<xtd::drawing::color, 2>&
linear_colors()
const {
return data_->linear_colors_;}
113 std::array<xtd::drawing::color, 2>&
linear_colors() {
return data_->linear_colors_;}
124 void recreate_handle();
128 std::array<xtd::drawing::color, 2> linear_colors_;
130 std::shared_ptr<data> data_ = std::make_shared<data>();
Defines objects used to fill the interiors of graphical shapes such as rectangles,...
Definition brush.h:27
Represents an ARGB (alpha, red, green, blue) color.
Definition color.h:39
Encapsulates a xtd::drawing::brush with a linear gradient. This class cannot be inherited.
Definition linear_gradient_brush.h:28
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.
Definition linear_gradient_brush.h:37
xtd::drawing::rectangle_f rectangle() const
Gets a rectangular region that defines the starting and ending points of the gradient.
const std::array< xtd::drawing::color, 2 > & linear_colors() const
Gets the starting and ending colors of the gradient.
Definition linear_gradient_brush.h:110
linear_gradient_brush()
Initializes a new instance of the linear_gradient_brush class.
linear_gradient_brush(const xtd::drawing::rectangle &rect, const xtd::drawing::color &color1, const xtd::drawing::color &color2, xtd::drawing::drawing2d::linear_gradient_mode linear_gradient_mode)
Initializes a new instance of the linear_gradient_brush class with the specified rectangle,...
Definition linear_gradient_brush.h:87
xtd::drawing::drawing2d::linear_gradient_brush & linear_colors(const std::array< xtd::drawing::color, 2 > &linear_colors)
sets the starting and ending colors of the gradient.
linear_gradient_brush(const xtd::drawing::rectangle_f &rect, const xtd::drawing::color &color1, const xtd::drawing::color &color2, xtd::drawing::drawing2d::linear_gradient_mode linear_gradient_mode)
Initializes a new instance of the linear_gradient_brush class with the specified rectangle,...
Definition linear_gradient_brush.h:64
std::array< xtd::drawing::color, 2 > & linear_colors()
Gets the starting and ending colors of the gradient.
Definition linear_gradient_brush.h:113
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.
Definition linear_gradient_brush.h:48
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...
Definition linear_gradient_brush.h:81
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...
Definition linear_gradient_brush.h:58
Represents an ordered pair of floating-point x- and y-coordinates that defines a point in a two-dimen...
Definition point_f.h:26
Represents an ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional ...
Definition point.h:48
Stores a set of four floating-points that represent the location and size of a rectangle.
Definition rectangle_f.h:28
Stores a set of four integers that represent the location and size of a rectangle.
Definition rectangle.h:25
#define drawing_export_
Define shared library export.
Definition drawing_export.h:13
linear_gradient_mode
Specifies the direction of a linear gradient.
Definition linear_gradient_mode.h:19
@ horizontal
Specifies a gradient from left to right.
@ backward_diagonal
Specifies a gradient from upper right to lower left.
@ vertical
Specifies a gradient from top to bottom.
@ horizontal
A pattern of horizontal lines.
Contains xtd::drawing::drawing2d::linear_gradient_mode enum class.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition system_report.h:17