Image

external class Image : Resource(source)

An RGBA Image in row-major order from top to bottom.

Instances are created with {@linkcode Image.new}, {@linkcode Image.fromBytes} or {@linkcode Image.fromPath} and can be passed wherever a {@linkcode JsImage} is accepted, such as Window.setIcon, TrayIcon.setIcon or an icon menu item.

Since

2.0.0

Constructors

Link copied to clipboard
constructor(rid: Double)

Creates an Image from a resource ID. For internal use only.

Types

Link copied to clipboard
external object Companion

Properties

Link copied to clipboard
external val rid: Double

Functions

Link copied to clipboard
external fun close(): Promise<Void>

Destroys and cleans up this resource from memory. You should not call any method on this object anymore and should drop any reference to it.

Link copied to clipboard

Returns the RGBA data for this image, in row-major order from top to bottom.

Link copied to clipboard
external fun size(): Promise<ImageSize>

Returns the size of this image, in pixels.