Skip to main content

OH_ImageSource_CreateFromUri

Function OH_ImageSource_CreateFromUri 

Source
pub unsafe extern "C" fn OH_ImageSource_CreateFromUri(
    env: napi_env,
    uri: *mut c_char,
    size: usize,
    ops: *mut OhosImageSourceOps,
    res: *mut napi_value,
) -> i32
Expand description

@brief Creates an ImageSource object at the JavaScript native layer based on the specified image source URI and {@link OhosImageSourceOps} structs.

@param env Indicates a pointer to the Java Native Interface (JNI) environment. @param uri Indicates a pointer to the image source URI. Only a file URI or Base64 URI is accepted. @param size Indicates the length of the image source URI. @param ops Indicates a pointer to the options for creating the image source. For details, see {@link OhosImageSourceOps}. @param res Indicates a pointer to the ImageSource object created at the JavaScript native layer. @return Returns {@link IRNdkErrCode} IMAGE_RESULT_SUCCESS - if the operation is successful. returns {@link IRNdkErrCode} IMAGE_RESULT_BAD_PARAMETER - if bad parameter. returns {@link IRNdkErrCode} IMAGE_RESULT_JNI_ENV_ABNORMAL - if Abnormal JNI environment. returns {@link IRNdkErrCode} IMAGE_RESULT_INVALID_PARAMETER - if invalid parameter. @see {@link OhosImageSourceOps}

@since 11 @version 4.1