#include <xtd/drawing/basic_colors>
#include <xtd/forms/application>
#include <xtd/forms/form>
#include <xtd/random>
namespace draw_point_example {
class form1 :
public form {
struct colored_point {
bool operator ==(
const colored_point& rhs)
const noexcept {
return location == rhs.location &&
color == rhs.color &&
width == rhs.width;}
};
public:
form1() {
text(
"Draw point example");
generate_colored_points_timer.interval(200_ms);
generate_colored_points_timer.tick += event_handler {*this, &form1::generate_colored_points};
generate_colored_points_timer.start();
}
protected:
for (auto colored_point : colored_points)
e.graphics().draw_point(
pen(colored_point.color,
as<float>(colored_point.width)), colored_point.location);
}
private:
void generate_colored_points() {
for (auto& colored_point : colored_points)
invalidate();
}
timer generate_colored_points_timer;
};
}
auto main() -> int {
}
Represents a strongly typed list of objects that can be accessed by index. Provides methods to search...
Definition list.hpp:80
static const xtd::array< xtd::drawing::color > & get_colors() noexcept
Gets an array of colors.
Represents an ARGB (alpha, red, green, blue) color.
Definition color.hpp:46
static const xtd::drawing::color black
Gets a system-defined color that has an ARGB value of 0xFF000000. This field is constant.
Definition color.hpp:80
colors for all the standard colors. This class cannot be inherited.
Definition colors.hpp:25
Defines an object used to draw lines and curves. This class cannot be inherited.
Definition pen.hpp:32
Represents a pseudo-random number generator, a device that produces a sequence of numbers that meet c...
Definition random.hpp:43
virtual int32 next() const
Returns a nonnegative random number.
type_t as(any_object &o)
Casts a type into another type.
Definition __as_any_object.hpp:59
@ e
The E key.
Definition console_key.hpp:96
The xtd::collections::generic namespace contains interfaces and classes that define generic collectio...
Definition comparer.hpp:16
The xtd::drawing namespace provides access to GDI+ basic graphics functionality. More advanced functi...
Definition actions_system_images.hpp:10
Contains classes that represent ASCII and Unicode character encodings; abstract base classes for conv...
Definition basic_string_builder.hpp:16
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
Represents an ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional ...
Definition point.hpp:54