Each property of the xtd::drawing::texture_brush class is a xtd::drawing::brush object that uses an image to fill the interior of a shape. This class cannot be inherited.
- Inheritance
- xtd::object → xtd::drawing::brush → xtd::drawing::texture_brush
- Namespace
- xtd::drawing
- Library
- xtd.drawing
- Examples
- The following code example demonstrates the use of texture_brush class.
#include <xtd/xtd>
namespace examples {
class form1 :
public form {
public:
form1() {
text("Fill rectangle example");
client_size({680, 340});
}
protected:
form::on_paint(e);
e.
graphics().
fill_rectangle(
linear_gradient_brush {
rectangle {180, 180, 150, 150}, back_color, fore_color, 315},
rectangle {180, 180, 150, 150});
}
private:
image create_circle_texture(
const color& fore_color,
const color& back_color) {
auto texture =
bitmap {16, 16};
auto graphics = texture.create_graphics();
return texture;
}
};
}
auto main()->int {
application::run(examples::form1 {});
}
- Examples:
- fill_ellipse.cpp, fill_rectangle.cpp, and fill_rounded_rectangle.cpp.
|
intptr | handle () const noexcept |
| Gets the handle of the brush. More...
|
|
bool | equals (const brush &value) const noexcept override |
|
xtd::ustring | to_string () const noexcept override |
| Converts this brush object to a human-readable string. More...
|
|
| object ()=default |
| Create a new instance of the ultimate base class object. More...
|
|
bool | equals (const object &obj) const noexcept |
| Determines whether the specified object is equal to the current object. More...
|
|
virtual size_t | get_hash_code () const noexcept |
| Serves as a hash function for a particular type. More...
|
|
template<typename object_t > |
std::unique_ptr< object_t > | memberwise_clone () const noexcept |
| Gets the type of the current instance. More...
|
|
virtual bool | equals (const brush &) const noexcept=0 |
| Indicates whether the current object is equal to another object of the same type. More...
|
|
virtual bool | equals (const texture_brush &) const noexcept=0 |
| Indicates whether the current object is equal to another object of the same type. More...
|
|
static bool | equals (const object &object_a, const object &object_b) noexcept |
| Determines whether the specified object instances are considered equal. More...
|
|
static bool | reference_equals (const object &object_a, const object &object_b) noexcept |
| Determines whether the specified object instances are the same instance. More...
|
|
| brush () |
| Initialize a new instance of brush class. More...
|
|
void | set_native_brush (intptr brush) |
| In a derived class, sets a reference to a GDI+ brush object. More...
|
|