Click or drag to resize

PdfiumFPDFBitmap_Create Method

Create a device independent bitmap with the specified width, height and isUseAlpha flag.

Namespace: Patagames.Pdf
Assembly: Patagames.Pdf (in Patagames.Pdf.dll) Version: 4.94.2704
Syntax
public static IntPtr FPDFBitmap_Create(
	int width,
	int height,
	bool isUseAlpha
)

Parameters

width  Int32
Number of pixels in a horizontal line of the bitmap. Must be greater than 0.
height  Int32
Number of pixels in a vertical line of the bitmap. Must be greater than 0.
isUseAlpha  Boolean
A flag indicating whether alpha channel is used. True for using alpha, false for not using.

Return Value

IntPtr
The created bitmap handle, or IntPtr.Zero if a parameter error or out of memory.
Remarks

A bitmap created by this function, always use 4 byte per pixel. The first byte of a pixel is always double word aligned. Each pixel contains red (R), green (G), blue (B) and optionally alpha (A) values. The byte order is BGRx (the last byte unused if no alpha channel) or ARGB.

The pixels in a horizontal line (also called scan line) are stored side by side, with left most pixel stored first (with lower memory address). Each scan line uses width*4 bytes. Scan lines are stored one after another, with top most scan line stored first. There is no gap between adjacent scan 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(IntPtr, Int32, Int32, Int32, Int32, Int32) or FPDFBitmap_Clear(IntPtr, UInt32) to fill the bitmap using any color.

When an application is finished using the bitmap handle returned by FPDFBitmap_Create(Int32, Int32, Boolean), use the FPDFBitmap_Destroy(IntPtr) function to close the handle.

See Also