public class SystemIcon extends RasterImage
Raster snapshot of an operating-system filesystem icon, stored in memory. Windows uses Shell file associations and volume icons; Linux uses GIO MIME associations and the desktop's GTK icon theme when those runtimes are present. No intermediate image file is written. Native pixels remain owned by the descriptor and by recorded Painter commands until they are no longer used.
Lookup may load desktop services or shell extensions. GUI widgets should do it on a worker and reuse the result; FileSystemTree handles this automatically. A snapshot retains its colors, including in selected rows. Acquire a new snapshot after changing desktop theme or file associations.
import klyn.gui.windows
import klyn.io
icon = SystemIcon.get(FilePath("report.pdf"), size=22)
if icon is not null:
painter.drawImage(icon, 8, 8, 22, 22)| Modifier and Type | Member | Description |
|---|---|---|
| public static | getget(path as Path, size as Int = 22, expanded as Boolean = false, volume as Boolean = false) as SystemIcon |
Gets a filesystem icon or null when the OS service cannot supply one. |