JsImage
A type that can be passed to Rust side as tauri::image::JsImage through {@linkcode transformImage}
Values of this type must go through {@linkcode transformImage} before being placed in invoke arguments; an {@linkcode Image} instance is not serializable on its own.
Variants
string: Path to an image in the filesystem. Maps to
JsImage::PathUint8Array | ArrayBuffer | number[]: ICO or PNG image in raw bytes. Maps to
JsImage::BytesImage: An image that was previously loaded with the API and is stored in the resource table. Maps to
JsImage::Resource
The string and bytes variants require the image-ico or image-png Cargo features. To enable them, change your Cargo.toml file:
[dependencies]
tauri = { version = "...", features = ["...", "image-png"] }The Rust JsImage::Rgba variant is intentionally not exposed here; use {@linkcode Image.new} to create an image from raw RGBA data instead.