Defined in: image.ts:38
A native image registered in the host. Create with fromPath/fromBytes
(and fromRGBA for raw pixels) and pass to tray.setIcon / setIcon.
readonlyrid:number
Defined in: image.ts:40
The host-side image registry id.
close():
Promise<void>
Defined in: image.ts:112
Releases the image in the host.
Promise<void>
rgba():
Promise<Uint8Array<ArrayBufferLike> |undefined>
Defined in: image.ts:96
The raw RGBA pixels this image was built from. Only images created via
Image.fromRGBA/new carry pixels; path/PNG-loaded images
resolve to undefined until C-layer decode lands (GAP.md B11).
Promise<Uint8Array<ArrayBufferLike> | undefined>
size():
Promise<{height:number;width:number; } |null>
Defined in: image.ts:104
Pixel dimensions (null when unknown — see Image.rgba).
Promise<{ height: number; width: number; } | null>
staticfromBytes(bytes):Promise<Image>
Defined in: image.ts:54
Loads an image from raw bytes.
number[] | Uint8Array<ArrayBufferLike>
Promise<Image>
staticfromPath(path):Promise<Image>
Defined in: image.ts:47
Loads an image from a file path.
string
Promise<Image>
staticfromRGBA(rgba,width,height):Promise<Image>
Defined in: image.ts:64
Builds an image from RGBA pixel data (upstream name: Image.new).
number[] | Uint8Array<ArrayBufferLike>
number
number
Promise<Image>
staticnew(rgba,width,height):Promise<Image>
Defined in: image.ts:83
Upstream-parity alias of Image.fromRGBA.
number[] | Uint8Array<ArrayBufferLike>
number
number
Promise<Image>
ImageLike =
string|Image|Uint8Array|ArrayBuffer|number[] |null
Defined in: image.ts:26
Anything an icon-accepting API takes (path / Image / raw bytes / none).
fromBase64(
b64):Uint8Array
Defined in: image.ts:18
Decodes a base64 string into bytes (chunked, for large payloads).
string
Uint8Array
toBase64(
bytes):string
Defined in: image.ts:8
Converts bytes to a base64 string for the wire.
Uint8Array
string
transformImage(
image):Promise<{image_id?:number;path?:string; } |null>
Defined in: image.ts:122
Normalizes an icon argument into the wire shape: a path string stays a
path, an Image becomes its registry id, and raw bytes are registered
(decoded host-side) first — a port of @tauri-apps/api transformImage.
Promise<{ image_id?: number; path?: string; } | null>