1# image_pixel_map_napi.h
2
3
4## Overview
5
6The **image_pixel_map_napi.h** file declares the APIs used to lock, access, and unlock a pixel map.
7
8**Library**: libpixelmap_ndk.z.so
9
10**File to include**: <multimedia/image_framework/image_pixel_map_napi.h>
11
12**Since**: 8
13
14**Deprecated from**: 8
15
16**Substitute**: [image_pixel_map_mdk.h](image__pixel__map__mdk_8h.md)
17
18**Related module**: [Image](image.md)
19
20
21## Summary
22
23
24### Structs
25
26| Name| Description| 
27| -------- | -------- |
28| struct  [OhosPixelMapInfo](_o_h_o_s_1_1_media_1_1_ohos_pixel_map_info.md) | Defines the information about a pixel map. | 
29
30
31### Enums
32
33| Name| Description| 
34| -------- | -------- |
35| { [OHOS_IMAGE_RESULT_SUCCESS](image.md#anonymous-enum-33) = 0,<br>[OHOS_IMAGE_RESULT_BAD_PARAMETER](image.md#anonymous-enum-33) = -1 } | Enumerates the error codes returned by the functions.| 
36| { [OHOS_PIXEL_MAP_FORMAT_NONE](image.md#anonymous-enum-33-1) = 0,<br>[OHOS_PIXEL_MAP_FORMAT_RGBA_8888](image.md#anonymous-enum-33-1) = 3,<br>[OHOS_PIXEL_MAP_FORMAT_RGB_565](image.md#anonymous-enum-33-1) = 2 } | Enumerates the pixel map formats.| 
37| { [OHOS_PIXEL_MAP_SCALE_MODE_FIT_TARGET_SIZE](image.md#anonymous-enum) = 0,<br>[OHOS_PIXEL_MAP_SCALE_MODE_CENTER_CROP](image.md#anonymous-enum) = 1 } | Enumerates the pixel map scale modes.| 
38
39
40### Functions
41
42| Name| Description| 
43| -------- | -------- |
44| int32_t [OH_GetImageInfo](image.md#oh_getimageinfo) (napi_env env, napi_value value, [OhosPixelMapInfo](_o_h_o_s_1_1_media_1_1_ohos_pixel_map_info.md) \*info) | Obtains the information about a **PixelMap** object and stores the information to the [OhosPixelMapInfo](_o_h_o_s_1_1_media_1_1_ohos_pixel_map_info.md) struct. | 
45| int32_t [OH_AccessPixels](image.md#oh_accesspixels) (napi_env env, napi_value value, void \*\*addrPtr) | Obtains the memory address of a **PixelMap** object and locks the memory. | 
46| int32_t [OH_UnAccessPixels](image.md#oh_unaccesspixels) (napi_env env, napi_value value) | Unlocks the memory of a **PixelMap** object. This function is used with **OH_AccessPixels** in pairs. | 
47