xtd - Reference Guide  0.1.1
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
color_picker.cpp

The following code example demonstrate the use of color_picker picker.

Windows

macOS

Gnome

#include <xtd/xtd>
using namespace xtd;
using namespace xtd::drawing;
using namespace xtd::forms;
namespace examples {
class form1 : public form {
public:
form1() {
text("Color picker example");
test_zone.parent(*this);
test_zone.location({10, 50});
test_zone.back_color(color::red);
test_zone.border_style(border_style::fixed_3d);
color_picker.parent(*this);
color_picker.color(test_zone.back_color());
color_picker.location({10, 10});
color_picker.color_changed += [&] {
test_zone.back_color(color_picker.color());
};
}
private:
forms::color_picker color_picker;
panel test_zone;
};
}
int main() {
application::run(examples::form1());
}
static const xtd::drawing::color red
Gets a system-defined color that has an ARGB value of 0xFFFF0000. This field is constant.
Definition: color.h:390
Represents a picker control that displays available colors along with controls that enable the user t...
Definition: color_picker.h:22
The xtd::drawing namespace provides access to GDI+ basic graphics functionality. More advanced functi...
Definition: bitmap.h:11
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition: about_box.h:13
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition: system_report.h:17