image
Classes
Section titled “Classes”Defined in: packages/api/src/image.ts:26
An RGBA Image in row-major order from top to bottom.
Extends
Section titled “Extends”Accessors
Section titled “Accessors”Get Signature
Section titled “Get Signature”get rid(): number;Defined in: packages/api/src/core.ts:318
Returns
Section titled “Returns”number
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”close()
Section titled “close()”close(): Promise<void>;Defined in: packages/api/src/core.ts:330
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.
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”rgba()
Section titled “rgba()”rgba(): Promise<Uint8Array>;Defined in: packages/api/src/image.ts:89
Returns the RGBA data for this image, in row-major order from top to bottom.
Returns
Section titled “Returns”size()
Section titled “size()”size(): Promise<ImageSize>;Defined in: packages/api/src/image.ts:96
Returns the size of this image.
Returns
Section titled “Returns”fromBytes()
Section titled “fromBytes()”static fromBytes(bytes): Promise<Image>;Defined in: packages/api/src/image.ts:62
Creates a new image using the provided bytes by inferring the file format. If the format is known, prefer [@link Image.fromPngBytes] or [@link Image.fromIcoBytes].
Only ico and png are supported (based on activated feature flag).
Note that you need the image-ico or image-png Cargo features to use this API.
To enable it, change your Cargo.toml file:
[dependencies]tauri = { version = "...", features = ["...", "image-png"] }Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
bytes |
| Uint8Array | ArrayBuffer | number[] |
Returns
Section titled “Returns”fromPath()
Section titled “fromPath()”static fromPath(path): Promise<Image>;Defined in: packages/api/src/image.ts:82
Creates a new image using the provided path.
Only ico and png are supported (based on activated feature flag).
Note that you need the image-ico or image-png Cargo features to use this API.
To enable it, change your Cargo.toml file:
[dependencies]tauri = { version = "...", features = ["...", "image-png"] }Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
path |
string |
Returns
Section titled “Returns”static new( rgba, width,height): Promise<Image>;Defined in: packages/api/src/image.ts:37
Creates a new Image using RGBA data, in row-major order from top to bottom, and with specified width and height.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
rgba |
| Uint8Array | ArrayBuffer | number[] |
width |
number |
height |
number |
Returns
Section titled “Returns”Interfaces
Section titled “Interfaces”ImageSize
Section titled “ImageSize”Defined in: packages/api/src/image.ts:9
Properties
Section titled “Properties”| Property | Type | Defined in |
|---|---|---|
height |
number |
packages/api/src/image.ts:13 |
width |
number |
packages/api/src/image.ts:11 |
Type Aliases
Section titled “Type Aliases”MenuIcon
Section titled “MenuIcon”type MenuIcon = | NativeIcon | string | Image | Uint8Array | ArrayBuffer | number[];Defined in: packages/api/src/image.ts:17
A type that represents an icon that can be used in menu items.
Functions
Section titled “Functions”transformImage()
Section titled “transformImage()”function transformImage<T>(image): T;Defined in: packages/api/src/image.ts:107
Transforms image from various types into a type acceptable by Rust.
See tauri::image::JsImage for more information. Note the API signature is not stable and might change.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
image |
| string | Image | Uint8Array | ArrayBuffer | number[] | null |
Returns
Section titled “Returns”T
© 2026 Tauri Contributors. CC-BY / MIT