fromPath

fun fromPath(absolutePath: String, anchor: Point? = null, scaledSize: Size? = null): Icon

Build an Icon from an absolute file path.

Decodes synchronously on the calling thread — for large files, invoke off the main thread.

val icon = Icon.fromPath("/sdcard/Download/pin.png")

Throws

if the file is missing or cannot be decoded.