Skip to main content

OH_Drawing_BitmapCreateFromPixels

Function OH_Drawing_BitmapCreateFromPixels 

Source
pub unsafe extern "C" fn OH_Drawing_BitmapCreateFromPixels(
    imageInfo: *mut OH_Drawing_Image_Info,
    pixels: *mut c_void,
    rowBytes: u32,
) -> *mut OH_Drawing_Bitmap
Expand description

@brief Creates an OH_Drawing_Bitmap object, with the address of the memory for storing the bitmap pixels set to the memory address that you applied for. This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. If either imageInfo or pixels is NULL or rowBytes is 0, OH_DRAWING_ERROR_INVALID_PARAMETER is returned.

@param imageInfo Pointer to an {@link OH_Drawing_Image_Info} object. @param pixels Pointer to the start address of the memory for storing the bitmap pixels. You need to apply for the memory and ensure its validity. @param rowBytes Number of bytes in each row of pixels. The value is invalid if it is less than or equal to 0. @return Returns a pointer to the {@link OH_Drawing_Bitmap} object created. @since 12 @version 1.0