FPDFBitmap_Create function

  1. @Native<FPDF_BITMAP Function(Int, Int, Int)>(ffi.Int, ffi.Int, ffi.Int)>()
FPDF_BITMAP FPDFBitmap_Create(
  1. int width,
  2. int height,
  3. int alpha
)

Function: FPDFBitmap_Create 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. alpha - A flag indicating whether the alpha channel is used. Non-zero for using alpha, zero for not using. Return value: The created bitmap handle, or NULL if a parameter error or out of memory. Comments: The bitmap always uses 4 bytes per pixel. The first byte is always double word aligned.

The byte order is BGRx (the last byte unused if no alpha channel) or BGRA.

The pixels in a horizontal line are stored side by side, with the left most pixel stored first (with lower memory address). Each line uses width * 4 bytes.

Lines are stored one after another, with the top most line stored first. There is no gap between adjacent lines.

This function allocates enough memory for holding all pixels in the bitmap, but it doesn't initialize the buffer. Applications can use FPDFBitmap_FillRect() to fill the bitmap using any color. If the OS allows it, this function can allocate up to 4 GB of memory.

Implementation

@ffi.Native<FPDF_BITMAP Function(ffi.Int, ffi.Int, ffi.Int)>()
external FPDF_BITMAP FPDFBitmap_Create(int width, int height, int alpha);