49 printf(
"CreateBitmap failed %lu\n", cBitsPerPixel);
54 memset(&bmiBuffer, 0,
sizeof(bmiBuffer));
67 if (cBitsPerPixel == 1)
69 bmiBuffer.bmiColors[0] = 0;
70 bmiBuffer.bmiColors[1] = 0xFFFFFF;
78 printf(
"CreateCompatibleDC failed %lu\n", cBitsPerPixel);
84 if (*phbmpDIB ==
NULL)
86 printf(
"CreateDIBSection failed. %lu\n", cBitsPerPixel);
102 printf(
"failed to create a palette\n");
113 printf(
"failed to create objects\n");
BOOL InitPerBitDepth(_In_ ULONG cBitsPerPixel, _In_ ULONG cx, _In_ ULONG cy, _Out_ HBITMAP *phbmp, _Out_ HDC *phdcDIB, _Out_ HBITMAP *phbmpDIB, _Out_ PVOID *ppvBits)
_In_ HBITMAP _In_ UINT _In_ UINT _Inout_ LPBITMAPINFO pbmi
_Out_opt_ int _Out_opt_ int * cy
BITMAPINFOHEADER bmiHeader
HBITMAP WINAPI CreateDIBSection(HDC hDC, CONST BITMAPINFO *BitmapInfo, UINT Usage, VOID **Bits, HANDLE hSection, DWORD dwOffset)
HBITMAP WINAPI CreateBitmap(_In_ INT cx, _In_ INT cy, _In_ UINT cPlanes, _In_ UINT cBitsPerPel, _In_opt_ const VOID *pvBits)
HPALETTE WINAPI CreatePalette(_In_reads_(_Inexpressible_(2 *sizeof(WORD)+plpal->palNumEntries *sizeof(PALETTEENTRY))) const LOGPALETTE *)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
struct tagBITMAPINFO * LPBITMAPINFO