Represents a Windows icon, which is a small bitmap image that is used to represent an object. Icons can be thought of as transparent bitmaps, although their size is determined by the system.
Represents a Windows icon, which is a small bitmap image that is used to represent an object....
Definition icon.h:28
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.h:42
#define drawing_export_
Define shared library export.
Definition drawing_export.h:13
- Inheritance
- xtd::object → xtd::drawing::icon
- Namespace
- xtd::drawing
- Library
- xtd.drawing
- Examples
- minesweeper.cpp, and stopwatch_form.cpp.
|
static icon | from_handle (intptr handle) |
| Creates a GDI+ xtd::drawing::icon from the specified Windows handle to an icon (HICON).
|
|
template<typename object_a_t , typename object_b_t > |
static bool | equals (const object_a_t &object_a, const object_b_t &object_b) noexcept |
| Determines whether the specified object instances are considered equal.
|
|
template<typename object_a_t , typename object_b_t > |
static bool | reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept |
| Determines whether the specified object instances are the same instance.
|
|
|
| icon (const xtd::string &filename) |
| Initializes a new instance of the xtd::drawing::icon class from the specified file name.
|
|
| icon (const xtd::string &filename, const xtd::drawing::size &size) |
| Initializes a new instance of the xtd::drawing::icon class of the specified size from the specified file.
|
|
| icon (const xtd::string &filename, int32 width, int32 height) |
| Initializes a new instance of the xtd::drawing::icon class with the specified width and height from the specified file.
|
|
| icon (std::istream &stream) |
| Initializes a new instance of the xtd::drawing::icon class from the specified data stream.
|
|
| icon (std::istream &stream, const xtd::drawing::size &size) |
| Initializes a new instance of the xtd::drawing::icon class of the specified size from the specified stream.
|
|
| icon (std::istream &stream, int32 width, int32 height) |
| Initializes a new instance of the xtd::drawing::icon class from the specified data stream and with the specified width and height.
|
|
| icon (const char *const *bits) |
| Initializes a new instance of the xtd::drawing::icon class from the specified data.
|
|
| icon (const char *const *bits, const xtd::drawing::size &size) |
| Initializes a new instance of the xtd::drawing::icon class of the specified size from the specified data.
|
|
| icon (const char *const *bits, int32 width, int32 height) |
| Initializes a new instance of the xtd::drawing::icon class from the specified data and with the specified width and height.
|
|
| icon (const icon &original, const xtd::drawing::size &size) |
| Initializes a new instance of the xtd::drawing::icon class and attempts to find a version of the icon that matches the requested size.
|
|
| icon (const icon &original, int32 width, int32 height) |
| Initializes a new instance of the xtd::drawing::icon class and attempts to find a version of the icon that matches the requested size.
|
|
|
| object ()=default |
| Create a new instance of the ultimate base class object.
|
|
virtual size_t | get_hash_code () const noexcept |
| Serves as a hash function for a particular type.
|
|
virtual type_object | get_type () const noexcept |
| Gets the type of the current instance.
|
|
template<typename object_t > |
xtd::uptr< object_t > | memberwise_clone () const |
| Creates a shallow copy of the current object.
|
|
virtual bool | equals (const icon &) const noexcept=0 |
| Indicates whether the current object is equal to another object of the same type.
|
|
◆ icon() [1/11]
xtd::drawing::icon::icon |
( |
const xtd::string & |
filename | ) |
|
|
explicit |
Initializes a new instance of the xtd::drawing::icon class from the specified file name.
- Parameters
-
◆ icon() [2/11]
Initializes a new instance of the xtd::drawing::icon class of the specified size from the specified file.
- Parameters
-
◆ icon() [3/11]
Initializes a new instance of the xtd::drawing::icon class with the specified width and height from the specified file.
- Parameters
-
◆ icon() [4/11]
xtd::drawing::icon::icon |
( |
std::istream & |
stream | ) |
|
|
explicit |
Initializes a new instance of the xtd::drawing::icon class from the specified data stream.
- Parameters
-
◆ icon() [5/11]
Initializes a new instance of the xtd::drawing::icon class of the specified size from the specified stream.
- Parameters
-
stream | The data stream from which to load the xtd::drawing::icon. |
size | The desired size of the icon. |
◆ icon() [6/11]
xtd::drawing::icon::icon |
( |
std::istream & |
stream, |
|
|
int32 |
width, |
|
|
int32 |
height |
|
) |
| |
Initializes a new instance of the xtd::drawing::icon class from the specified data stream and with the specified width and height.
- Parameters
-
stream | The data stream from which to load the xtd::drawing::icon. |
width | The width, in pixels, of the icon. |
height | The height, in pixels, of the icon. |
◆ icon() [7/11]
xtd::drawing::icon::icon |
( |
const char *const * |
bits | ) |
|
|
explicit |
Initializes a new instance of the xtd::drawing::icon class from the specified data.
- Parameters
-
◆ icon() [8/11]
Initializes a new instance of the xtd::drawing::icon class of the specified size from the specified data.
- Parameters
-
stream | The data stream from which to load the xtd::drawing::icon. |
size | The desired size of the icon. |
◆ icon() [9/11]
xtd::drawing::icon::icon |
( |
const char *const * |
bits, |
|
|
int32 |
width, |
|
|
int32 |
height |
|
) |
| |
Initializes a new instance of the xtd::drawing::icon class from the specified data and with the specified width and height.
- Parameters
-
stream | The data stream from which to load the xtd::drawing::icon. |
width | The width, in pixels, of the icon. |
height | The height, in pixels, of the icon. |
◆ icon() [10/11]
Initializes a new instance of the xtd::drawing::icon class and attempts to find a version of the icon that matches the requested size.
- Parameters
-
◆ icon() [11/11]
xtd::drawing::icon::icon |
( |
const icon & |
original, |
|
|
int32 |
width, |
|
|
int32 |
height |
|
) |
| |
Initializes a new instance of the xtd::drawing::icon class and attempts to find a version of the icon that matches the requested size.
- Parameters
-
original | The xtd::drawing::icon from which to load the newly sized icon. |
width | The width of the new icon. |
height | The height of the new icon. |
◆ handle()
intptr xtd::drawing::icon::handle |
( |
| ) |
const |
|
noexcept |
Gets the handle of this icon. This is not a copy of the handle; do not free it.
- Returns
- The Windows handle for the icon.
◆ height()
int32 xtd::drawing::icon::height |
( |
| ) |
const |
|
noexcept |
◆ size()
◆ width()
int32 xtd::drawing::icon::width |
( |
| ) |
const |
|
noexcept |
◆ save() [1/2]
void xtd::drawing::icon::save |
( |
const xtd::string & |
filename | ) |
const |
Saves this xtd::drawing::icon to the specified output filename.
- Parameters
-
filename | The file to save to. |
◆ save() [2/2]
void xtd::drawing::icon::save |
( |
std::ostream & |
stream | ) |
const |
Saves this xtd::drawing::icon to the specified output std::ostream.
- Parameters
-
stream | The std::ostream to save to. |
◆ to_bitmap()
◆ to_string()
◆ from_handle()
static icon xtd::drawing::icon::from_handle |
( |
intptr |
handle | ) |
|
|
static |
Creates a GDI+ xtd::drawing::icon from the specified Windows handle to an icon (HICON).
- Parameters
-
handle | A Windows handle to an icon. |
- Returns
- The xtd::drawing::icon this method creates.
◆ from_bitmap()
◆ equals() [1/2]
virtual bool xtd::object::equals |
( |
const object & |
obj | ) |
const |
|
virtualnoexcept |
Determines whether the specified object is equal to the current object.
- Parameters
-
obj | The object to compare with the current object. |
- Returns
- true if the specified object is equal to the current object. otherwise, false.
- Examples
- The following code example compares the current instance with another object.
#include <xtd/console>
auto main() -> int {
auto object1 = new_ptr<object>();
auto object2 = new_ptr<object>();
auto object3 = object2;
object3 = object1;
}
static void write_line()
Writes the current line terminator to the standard output stream using the specified format informati...
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10
Reimplemented from xtd::object.
◆ equals() [2/2]
template<typename object_a_t , typename object_b_t >
static bool xtd::object::equals |
( |
const object_a_t & |
object_a, |
|
|
const object_b_t & |
object_b |
|
) |
| |
|
inlinestaticnoexcept |
Determines whether the specified object instances are considered equal.
- Parameters
-
object_a | The first object to compare. |
object_b | The second object to compare. |
- Returns
- true if object_a is the same instance as object_b or if both are null references or if object_a(object_b) returns true. otherwise, false.
- Examples
- The following code example compares different objects.
#include <xtd/console>
auto main() -> int {
string s1 = "Tom";
string s2 = "Carol";
s1 = "Tom";
s2 = "Tom";
s1 = "";
s2 = "Tom";
s1 = "Carol";
s2 = "";
s1 = "";
s2 = "";
}
virtual bool equals(const object &obj) const noexcept
Determines whether the specified object is equal to the current object.
The documentation for this class was generated from the following file:
- xtd.drawing/include/xtd/drawing/icon.h