#include <icon.h>
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.
Fileds | |
static icon | empty |
Constructors | |
icon (const xtd::ustring &filename) | |
Initializes a new instance of the xtd::drawing::icon class from the specified file name. More... | |
icon (const xtd::ustring &filename, const xtd::drawing::size &size) | |
Initializes a new instance of the xtd::drawing::icon class of the specified size from the specified file. More... | |
icon (const xtd::ustring &filename, int32_t width, int32_t height) | |
Initializes a new instance of the xtd::drawing::icon class with the specified width and height from the specified file. More... | |
icon (std::istream &stream) | |
Initializes a new instance of the xtd::drawing::icon class from the specified data stream. More... | |
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. More... | |
icon (std::istream &stream, int32_t width, int32_t height) | |
Initializes a new instance of the xtd::drawing::icon class from the specified data stream and with the specified width and height. More... | |
icon (const char *const *bits) | |
Initializes a new instance of the xtd::drawing::icon class from the specified data. More... | |
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. More... | |
icon (const char *const *bits, int32_t width, int32_t height) | |
Initializes a new instance of the xtd::drawing::icon class from the specified data and with the specified width and height. More... | |
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. More... | |
icon (const icon &original, int32_t width, int32_t 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. More... | |
Properties | |
intptr_t | handle () const |
Gets the handle of this icon. This is not a copy of the handle; do not free it. More... | |
int32_t | height () const |
Gets the height of this xtd::drawing::icon. More... | |
const xtd::drawing::size & | size () const |
Gets the size of this xtd::drawing::icon. More... | |
int32_t | width () const |
Gets the width of this xtd::drawing::icon. More... | |
Methods | |
void | save (const xtd::ustring &filename) const |
Saves this xtd::drawing::icon to the specified output filename. More... | |
void | save (std::ostream &stream) const |
Saves this xtd::drawing::icon to the specified output std::ostream. More... | |
xtd::drawing::bitmap | to_bitmap () const |
Converts this xtd::drawing::icon to a GDI+ xtd::drawing::bitmap. More... | |
xtd::ustring | to_string () const noexcept override |
Gets a human-readable string that describes the xtd::drawing::icon. More... | |
static icon | from_handle (intptr_t handle) |
Creates a GDI+ xtd::drawing::icon from the specified Windows handle to an icon (HICON). More... | |
static icon | from_bitmap (const xtd::drawing::bitmap &bitmap) |
Creates a GDI+ xtd::drawing::icon from the specified bitmap. More... | |
Additional Inherited Members | |
![]() | |
object ()=default | |
Create a new instance of the ultimate base class object. More... | |
virtual 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 |
Gets the type of the current instance. 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... | |
|
explicit |
Initializes a new instance of the xtd::drawing::icon class from the specified file name.
filename | The file to load the xtd::drawing::icon from. |
xtd::drawing::icon::icon | ( | const xtd::ustring & | filename, |
const xtd::drawing::size & | size | ||
) |
Initializes a new instance of the xtd::drawing::icon class of the specified size from the specified file.
filename | The file to load the xtd::drawing::icon from. |
size | The desired size of the icon. |
xtd::drawing::icon::icon | ( | const xtd::ustring & | filename, |
int32_t | width, | ||
int32_t | height | ||
) |
Initializes a new instance of the xtd::drawing::icon class with the specified width and height from the specified file.
filename | The file to load the xtd::drawing::icon from. |
width | The desired width of the xtd::drawing::icon. |
height | The desired height of the xtd::drawing::icon. |
|
explicit |
Initializes a new instance of the xtd::drawing::icon class from the specified data stream.
stream | The data stream from which to load the xtd::drawing::icon. |
xtd::drawing::icon::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.
stream | The data stream from which to load the xtd::drawing::icon. |
size | The desired size of the icon. |
xtd::drawing::icon::icon | ( | std::istream & | stream, |
int32_t | width, | ||
int32_t | height | ||
) |
Initializes a new instance of the xtd::drawing::icon class from the specified data stream and with the specified width and height.
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. |
|
explicit |
Initializes a new instance of the xtd::drawing::icon class from the specified data.
stream | The data stream from which to load the xtd::drawing::icon. |
xtd::drawing::icon::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.
stream | The data stream from which to load the xtd::drawing::icon. |
size | The desired size of the icon. |
xtd::drawing::icon::icon | ( | const char *const * | bits, |
int32_t | width, | ||
int32_t | height | ||
) |
Initializes a new instance of the xtd::drawing::icon class from the specified data and with the specified width and height.
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. |
xtd::drawing::icon::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.
original | The xtd::drawing::icon from which to load the newly sized icon. |
size | A xtd::drawing::size structure that specifies the height and width of the new xtd::drawing::icon. |
xtd::drawing::icon::icon | ( | const icon & | original, |
int32_t | width, | ||
int32_t | 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.
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. |
|
static |
Creates a GDI+ xtd::drawing::icon from the specified bitmap.
bitmap | A xtd::drawing::bitmap use to create xtd::drawing::icon. |
|
static |
Creates a GDI+ xtd::drawing::icon from the specified Windows handle to an icon (HICON).
handle | A Windows handle to an icon. |
intptr_t xtd::drawing::icon::handle | ( | ) | const |
Gets the handle of this icon. This is not a copy of the handle; do not free it.
int32_t xtd::drawing::icon::height | ( | ) | const |
Gets the height of this xtd::drawing::icon.
void xtd::drawing::icon::save | ( | const xtd::ustring & | filename | ) | const |
Saves this xtd::drawing::icon to the specified output filename.
filename | The file to save to. |
void xtd::drawing::icon::save | ( | std::ostream & | stream | ) | const |
Saves this xtd::drawing::icon to the specified output std::ostream.
stream | The std::ostream to save to. |
const xtd::drawing::size& xtd::drawing::icon::size | ( | ) | const |
Gets the size of this xtd::drawing::icon.
xtd::drawing::bitmap xtd::drawing::icon::to_bitmap | ( | ) | const |
Converts this xtd::drawing::icon to a GDI+ xtd::drawing::bitmap.
|
inlineoverridevirtualnoexcept |
Gets a human-readable string that describes the xtd::drawing::icon.
Reimplemented from xtd::object.
int32_t xtd::drawing::icon::width | ( | ) | const |
Gets the width of this xtd::drawing::icon.