SystemIcon
classin packageklyn.gui.windows
public class SystemIcon extends RasterImage
└ SystemIcon

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)
Inherited Properties
propertyInherited Properties from RasterImage: height, width
propertyInherited Properties from Image: fileName, height, width
Methods
Modifier and Type Member Description
public static get
get(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.
Inherited Methods
methodInherited Methods from RasterImage: crop, load, render, resize
methodInherited Methods from Image: crop, getImage, load, resize