FPDFBitmap_CreateEx function
Function: FPDFBitmap_CreateEx Create a device independent bitmap (FXDIB) Parameters: width - The number of pixels in width for the bitmap. Must be greater than 0. height - The number of pixels in height for the bitmap. Must be greater than 0. format - A number indicating for bitmap format, as defined above. first_scan - A pointer to the first byte of the first line if using an external buffer. If this parameter is NULL, then a new buffer will be created. stride - Number of bytes for each scan line. The value must be 0 or greater. When the value is 0, FPDFBitmap_CreateEx() will automatically calculate the appropriate value using |width| and |format|. When using an external buffer, it is recommended for the caller to pass in the value. When not using an external buffer, it is recommended for the caller to pass in 0. Return value: The bitmap handle, or NULL if parameter error or out of memory. Comments: Similar to FPDFBitmap_Create function, but allows for more formats and an external buffer is supported. The bitmap created by this function can be used in any place that a FPDF_BITMAP handle is required.
If an external buffer is used, then the caller should destroy the buffer. FPDFBitmap_Destroy() will not destroy the buffer.
It is recommended to use FPDFBitmap_GetStride() to get the stride value.
Implementation
@ffi.Native<
FPDF_BITMAP Function(
ffi.Int,
ffi.Int,
ffi.Int,
ffi.Pointer<ffi.Void>,
ffi.Int,
)
>()
external FPDF_BITMAP FPDFBitmap_CreateEx(
int width,
int height,
int format,
ffi.Pointer<ffi.Void> first_scan,
int stride,
);