/*
call GetDIBits
with a NULL
lpBits param,
so it will
calculate
the * biSizeImage field
for us */ GetDIBits(pDC->m_hDC,(HBITMAP)bitmap.m_hObject,
0L, (DWORD)bi.biHeight, (LPBYTE)NULL, (LPBITMAPINFO)lpbi,
(DWORD)DIB_RGB_COLORS);

bi = *lpbi;
GlobalUnlock(hdib);

/* If the
driver did
not fill
in the biSizeImage
field, make
one up */ if (bi.biSizeImage == 0) bi.biSizeImage = WIDTHBYTES((DWORD)bm.bmWidth
* BiBits)
* bm.bmHeight;