# Interface: IImage

引擎原生图片接口。

## Table of contents

### Properties

- autoRelease
- data
- height
- localPath
- onerror
- onload
- premultiplyAlpha
- src
- type
- width

## Properties

### autoRelease

• `Optional` **autoRelease**: `boolean`

对于`ArrayBuffer`创建的图片，第一次使用后是否要自动释放内存，在`xr-frame`中，默认自动释放。

___

### data

• `Optional` `Readonly` **data**: `ArrayBuffer` \| `HTMLImageElement`

解码数据，视不同Backend而定。

___

### height

• **height**: `number`

图片高度。

___

### localPath

• `Optional` **localPath**: `string`

图片本地缓存地址，仅在微信内有用。

___

### onerror

• **onerror**: (`error`: `Error`) => `void`

#### Type declaration

▸ (`error`): `void`

出错的回调。

##### Parameters

| Name | Type |
| :------ | :------ |
| `error` | `Error` |

##### Returns

`void`

___

### onload

• **onload**: () => `void`

#### Type declaration

▸ (): `void`

加载完成的回调。

##### Returns

`void`

___

### premultiplyAlpha

• **premultiplyAlpha**: `boolean`

是否要预乘Alpha。

___

### src

• **src**: `string` \| `ArrayBufferView` \| `ArrayBuffer`

图片地址或者待解码的ArrayBuffer。

___

### type

• `Optional` **type**: `string`

图片源于ArrayBuffer时，传入的mimetype。

___

### width

• **width**: `number`

图片宽度。
