image
An RGBA Image in row-major order from top to bottom.
get rid(): number
number
Source: undefined
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.
Promise
<void
>
Source: undefined
rgba(): Promise<Uint8Array>
Returns the RGBA data for this image, in row-major order from top to bottom.
Source: undefined
size(): Promise<ImageSize>
Returns the size of this image.
Source: undefined
static fromBytes(bytes): Promise<Image>
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"] }
Parameter | Type |
---|---|
bytes | Uint8Array | number [] | ArrayBuffer |
Source: undefined
static fromPath(path): Promise<Image>
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"] }
Parameter | Type |
---|---|
path | string |
Source: undefined
static new( rgba, width,height): Promise<Image>
Creates a new Image using RGBA data, in row-major order from top to bottom, and with specified width and height.
Parameter | Type |
---|---|
rgba | Uint8Array | number [] | ArrayBuffer |
width | number |
height | number |
Source: undefined
Property | Type | Defined in |
---|---|---|
height | number | Source: undefined |
width | number | Source: undefined |
type MenuIcon: | NativeIcon | string | Image | Uint8Array | ArrayBuffer | number[];
A type that represents an icon that can be used in menu items.
Source: undefined
function transformImage<T>(image): T
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 Parameter |
---|
T |
Parameter | Type |
---|---|
image | | null | string | Uint8Array | number [] | ArrayBuffer | Image |
T
Source: undefined
Tauri v2.8 中文网 - 粤ICP备13048890号
Nodejs.cn 旗下网站