• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# OH_ImageSourceNative
2
3## Overview
4
5The OH_ImageSourceNative struct describes the image source, which is encapsulated at the native layer and is used to create image data. The struct cannot be directly operated. Instead, functions must be called to create and release the struct and operate the fields in the struct.
6
7You can create an OH_ImageSourceNative object in multiple ways, as described below.
8
9| API| Description|
10| -------- | -------- |
11| [OH_ImageSourceNative_CreateFromUri](capi-image-source-native-h.md#oh_imagesourcenative_createfromuri) |Creates an OH_ImageSourceNative object based on a URI.|
12| [OH_ImageSourceNative_CreateFromFd](capi-image-source-native-h.md#oh_imagesourcenative_createfromfd) |Creates an OH_ImageSourceNative object based on a file descriptor.|
13| [OH_ImageSourceNative_CreateFromData](capi-image-source-native-h.md#oh_imagesourcenative_createfromdata) |Creates an OH_ImageSourceNative object based on buffer data.|
14| [OH_ImageSourceNative_CreateFromRawFile](capi-image-source-native-h.md#oh_imagesourcenative_createfromrawfile) |Creates an OH_ImageSourceNative object by using the raw file descriptor of an image resource file.|
15| [OH_ImageSourceNative_CreatePixelmap](capi-image-source-native-h.md#oh_imagesourcenative_createpixelmap) |Creates an OH_PixelmapNative object based on decoding options.|
16| [OH_ImageSourceNative_CreatePixelmapList](capi-image-source-native-h.md#oh_imagesourcenative_createpixelmaplist) |Creates an array of OH_PixelmapNative objects based on decoding options.|
17
18To release an OH_ImageSourceNative object, call [OH_ImageSourceNative_Release](capi-image-source-native-h.md#oh_imagesourcenative_release).
19
20The table below describes the content and operation mode of the OH_ImageSourceNative struct.
21
22| Field Type| Field Name| Field Description|Operation Function| Function Description|
23| -------- | -------- | -------- | -------- | -------- |
24| int32_t | delayTimeList | Image delay time list.| [OH_ImageSourceNative_GetDelayTimeList](capi-image-source-native-h.md#oh_imagesourcenative_getdelaytimelist) |Obtains the image delay time list.|
25| OH_ImageSource_Info | info | Image source information.| [OH_ImageSourceNative_GetImageInfo](capi-image-source-native-h.md#oh_imagesourcenative_getimageinfo) |Obtains the information about an image with a given index.|
26| Image_String | value | Configuration item.| [OH_ImageSourceNative_GetImageProperty](capi-image-source-native-h.md#oh_imagesourcenative_getimageproperty) |Obtains the value of an image property.|
27| Image_String | value | Configuration item.| [OH_ImageSourceNative_ModifyImageProperty](capi-image-source-native-h.md#oh_imagesourcenative_modifyimageproperty) |Modifies the value of an image property.|
28| uint32_t | frameCount | Number of frames.| [OH_ImageSourceNative_GetFrameCount](capi-image-source-native-h.md#oh_imagesourcenative_getframecount) |Obtains the number of image frames.|
29
30**Since**: 12
31
32**Related module**: [Image_NativeModule](capi-image-nativemodule.md)
33
34**Header file**: [image_source_native.h](capi-image-source-native-h.md)
35