The EngCreateBitmap function requests that GDI create and manage a bitmap.
HBITMAP EngCreateBitmap( SIZEL sizl, LONG lWidth, _In_ ULONG iFormat, _In_ FLONG fl, _In_ PVOID pvBits );
Specifies a SIZEL structure whose members contain the width and height, in pixels, of the bitmap to be created. A SIZEL structure is identical to a SIZE structure.
If pvBits is not NULL, this value should represent all pixels visible on the device, allowing the device to keep off-screen memory.
Specifies the allocation width of the bitmap, which is the number of bytes that must be added to a pointer to move down one scan line.
- iFormat [in]
Specifies the format of the bitmap in terms of the number of bits of color information per pixel that are required. This parameter can be one of the following values:
4 bits per pixel
8 bits per pixel
16 bits per pixel
24 bits per pixel
32 bits per pixel
4 bits per pixel; run length encoded
8 bits per pixel; run length encoded
- fl [in]
Is a bitmask that specifies properties about the bitmap to be created. This parameter can be zero, or any combination of the following values:
GDI will not zero-initialize the bitmap when allocating it. This flag is checked only when pvBits is NULL.
The first scan line represents the top of the bitmap. Note that standard-format bitmaps have the first scan line at the bottom by default.
GDI will allocate the memory for the bitmap from user memory. By default, the memory is allocated from the kernel's address space. This flag should be specified only when the bitmap being created will not be used by other processes. User memory cannot be passed to EngWritePrinter by the printer driver.
- pvBits [in]
Pointer to the first scan line of the bitmap that is to be created. If this parameter is NULL, GDI allocates the storage space for the pixels of the bitmap. If pvBits is not NULL, it is a pointer to the buffer for the bitmap.
If the function completes successfully, the return value is a handle that identifies the created bitmap. Otherwise, the return value is 0. EngCreateBitmap does not log an error code.
Storage for the bitmap can optionally be provided by the driver.
The bitmap should be deleted by using EngDeleteSurface when it is no longer needed.
Frame buffer display drivers should use the pvBits parameter, allowing GDI to do most drawing directly to the display.
|Available in Windows 2000 and later versions of the Windows operating systems.|