M_PDFiumSharp_PDFium_FPDFBitmap_Create - ArgusMagnus/PDFiumSharp GitHub Wiki

PDFium.FPDFBitmap_Create Method

Create a device independent bitmap (FXDIB).

Namespace: PDFiumSharp
Assembly: PDFiumSharp (in PDFiumSharp.dll) Version: 1.0.0

Syntax

C#

public static FPDF_BITMAP FPDFBitmap_Create(
	int width,
	int height,
	bool hasAlpha
)

Parameters

 

width
Type: System.Int32
The number of pixels in width for the bitmap. Must be greater than 0.
height
Type: System.Int32
The number of pixels in height for the bitmap. Must be greater than 0.
hasAlpha
Type: System.Boolean
A value indicating whether the alpha channel is used.

Return Value

Type: FPDF_BITMAP
The bitmap handle, or Zero if parameter error or out of memory.

Remarks

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(FPDF_BITMAP, Int32, Int32, Int32, Int32, FPDF_COLOR) to fill the bitmap using any color.

See Also

Reference

PDFium Class
PDFiumSharp Namespace
PDFiumBitmap.PDFiumBitmap(Int32, Int32, Boolean)

⚠️ **GitHub.com Fallback** ⚠️