pub unsafe extern "C" fn OH_ImageSourceNative_CreateFromDataWithUserBuffer(
data: *mut u8,
datalength: usize,
imageSource: *mut *mut OH_ImageSourceNative,
) -> ImageResultAvailable on crate features
api-12 and image-source and api-20 only.Expand description
Create an image source from data buffer. The data buffer is directly accessed by the image source object, and therefore the data buffer must remain accessible within the lifecycle of the image source object.
§Arguments
-
data- Pointer to the data buffer. -
datalength- Length of the data buffer. -
imageSource- Double pointer to the image source.
§Returns
- Result code.
[
IMAGE_SUCCESS] if the execution is successful. [IMAGE_SOURCE_INVALID_PARAMETER] if data or imageSource is a null pointer or if datalength is 0.
Available since API-level: 20