> The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> **NOTE**
>
> API version 9 is a canary release for trial use. The APIs of this version may be unstable.
> The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## Modules to Import
```
```js
importimagefrom'@ohos.multimedia.image';
```
...
...
@@ -22,8 +21,8 @@ Creates a **PixelMap** object. This API uses a promise to return the result.
| options | [InitializetionOptions](#initializationoptions8) | Yes | Pixel properties, including the alpha type, size, scale mode, pixel format, and editable.|
| colors | ArrayBuffer | Yes | Color array in BGRA_8888 format. |
| options | [InitializationOptions](#initializationoptions8) | Yes | Pixel properties, including the alpha type, size, scale mode, pixel format, and editable.|
**Return value**
...
...
@@ -34,9 +33,11 @@ Creates a **PixelMap** object. This API uses a promise to return the result.
| supportedFormats | Array\<string> | Yes | No | Supported image format, which can be jpeg.<br>**System capability**: SystemCapability.Multimedia.Image|
| Promise\<void> | Promise used to return the result.|
**Example**
```js
receiver.release().then(()=>{
console.log('release succeeded.');
}).catch(error=>{
console.log('release failed.');
})
```
## Image<sup>9+</sup>
Provides APIs for basic image operations, including obtaining image information and reading and writing image data. An **Image** instance is returned when [readNextImage](#readnextimage9) and [readLatestImage](#readlatestimage9) are called.
Obtains the component buffer from the **Image** instance based on the color component type. This API uses an asynchronous callback to return the result.
| pixels | ArrayBuffer | Yes | No | Pixels of the image. |
| offset | number | Yes | No | Offset for data reading. |
| stride | number | Yes | No | Number of bytes from one row of pixels in memory to the next row of pixels in memory. The value of **stride** must be greater than or equal to the value of **region.size.width** multiplied by 4. |
| stride | number | Yes | No | Number of bytes from one row of pixels in memory to the next row of pixels in memory. The value of **stride** must be greater than or equal to the value of **region.size.width** multiplied by 4. |
| region | [Region](#region7) | Yes | No | Region to read or write. The width of the region to write plus the X coordinate cannot be greater than the width of the original image. The height of the region to write plus the Y coordinate cannot be greater than the height of the original image.|
## ImageInfo
...
...
@@ -983,7 +1455,7 @@ Describes the size of an image.