xtd 0.2.0
Loading...
Searching...
No Matches
icon.h
Go to the documentation of this file.
1
4#pragma once
5#include "../drawing_export.h"
6#include "bitmap.h"
7#include <xtd/iequatable>
8#include <xtd/object>
9#include <xtd/ustring>
10#include <cstdint>
11#include <memory>
12
14namespace xtd {
16 namespace drawing {
28 class drawing_export_ icon : public xtd::object, public xtd::iequatable<icon> {
29 struct data;
30
31 public:
33
35 static icon empty;
37
39
48 explicit icon(const xtd::ustring& filename);
54 icon(const xtd::ustring& filename, const xtd::drawing::size& size);
61 icon(const xtd::ustring& filename, int32 width, int32 height);
69 explicit icon(std::istream& stream);
73 icon(std::istream& stream, const xtd::drawing::size& size);
78 icon(std::istream& stream, int32 width, int32 height);
87 explicit icon(const char* const* bits);
92 icon(const char* const* bits, const xtd::drawing::size& size);
98 icon(const char* const* bits, int32 width, int32 height);
103 icon(const icon& original, const xtd::drawing::size& size);
109 icon(const icon& original, int32 width, int32 height);
111
113 icon();
114 icon(const icon& icon) = default;
115 icon& operator =(const icon& icon) = default;
116 ~icon();
118
120
124 intptr handle() const noexcept;
125
128 int32 height() const noexcept;
129
132 const xtd::drawing::size& size() const noexcept;
133
136 int32 width() const noexcept;
138
140
142 bool equals(const icon& icon) const noexcept override;
143
146 void save(const xtd::ustring& filename) const;
149 void save(std::ostream& stream) const;
150
154 xtd::drawing::bitmap to_bitmap() const;
155
158 xtd::ustring to_string() const noexcept override;
160
165 static icon from_handle(intptr handle);
166
168
173 static icon from_bitmap(const xtd::drawing::bitmap& bitmap);
175
176 private:
177 explicit icon(const bitmap& bitmap);
178
179 std::shared_ptr<data> data_;
180 };
181 }
182}
Contains xtd::drawing::bitmap class.
Encapsulates a GDI+ bitmap, which consists of the pixel data for a graphics image and its attributes....
Definition bitmap.h:26
Represents a Windows icon, which is a small bitmap image that is used to represent an object....
Definition icon.h:28
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...
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 d...
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...
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 s...
icon(const xtd::ustring &filename)
Initializes a new instance of the xtd::drawing::icon class from the specified file name.
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 speci...
intptr handle() const noexcept
Gets the handle of this icon. This is not a copy of the handle; do not free it.
icon(const xtd::ustring &filename, int32 width, int32 height)
Initializes a new instance of the xtd::drawing::icon class with the specified width and height from t...
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 th...
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 f...
icon(std::istream &stream)
Initializes a new instance of the xtd::drawing::icon class from the specified data stream.
Stores an ordered pair of integers, which specify a height and width.
Definition size.h:31
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.h:18
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.h:32
Represents text as a sequence of UTF-8 code units.
Definition ustring.h:47
#define drawing_export_
Define shared library export.
Definition drawing_export.h:13
int_least32_t int32
Represents a 32-bit signed integer.
Definition types.h:131
intmax_t intptr
Represent a pointer or a handle.
Definition types.h:153
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10