wx_icons_hicolor.icon
¶
Class to represent icons.
Classes:
|
Represents an icon. |
-
class
Icon
(name, path, size, type='Threshold', max_size=None, min_size=None, theme='')[source]¶ Bases:
Dictable
Represents an icon.
- Parameters
name (
str
) – The name of the icon.size (
int
) – Nominal (unscaled) size of the icon.type (
Literal
['Fixed'
,'Scalable'
,'Threshold'
]) – The type of icon sizes for the icon. Valid types are'Fixed'
,'Scalable'
and'Threshold'
. The type decides what other keys in the section are used. Default'Threshold'
.max_size (
Optional
[int
]) – Specifies the maximum (unscaled) size that the icon can be scaled to. Defaults to the value ofSize
if not present.min_size (
Optional
[int
]) – Specifies the minimum (unscaled) size that the icon can be scaled to. Defaults to the value ofSize
if not present.theme (
str
) – The name of the theme this icon came from. Default''
.
Methods:
__eq__
(other)Return
self == other
.__repr__
()Return a string representation of the
Icon
.as_base64_png
([size])Returns the icon as a base64-encoded object containing PNG image data.
as_bitmap
([size])Returns the icon as a wxPython bitmap.
as_png
([size])Returns the icon as a
BytesIO
object containing PNG image data.Attributes:
The mime type of the icon.
Whether the icon is scalable.
-
as_base64_png
(size=None)[source]¶ Returns the icon as a base64-encoded object containing PNG image data.
- Return type
- Returns
Base64-encoded string representing the PNG image.
-
as_png
(size=None)[source]¶ Returns the icon as a
BytesIO
object containing PNG image data.- Return type
- Returns
io.BytesIO
object representing the PNG image.