How do I create an HBITMAP out of this array?
I have tried using CreateBitmap but it doesnt work properly.
Jump to content
Posted 09 December 1999 - 01:45 PM
I have a pointer which contains my 640x480x24bit data, (BYTE* imageData).
I need to create an HBITMAP to pass on to DDCopyBitmap so I can load the image data onto a DDraw surface.
I have filled out a BITMAPINFO called lpbi,
then i make an HDC and the bits pointer, then create the hbitmap...
HDC hDC = GetDC( NULL );
BYTE* BitmapBits = NULL;
HBITMAP hBitmap = CreateDIBSection(hDC,lpbi,
ok i have an hbitmap with empty data,
?? what next ??
should I memcpy the imageData to the BitmapBits, then do a DDCopyBitmap(..)
Or can I assign the 4th param in CreateDibSection to my imageData?
(preffered to save memory space)
Posted 09 December 1999 - 01:57 PM
the memcpy way worked, but still I am allocating too much memory, can I assign the 4th param to the imageData (already contains the bitmap data)?
my image files are 24bit, but my surfaces are 16bit. Does DDraw (DDCopyBitmap) altomatically convert the bitmaps to 16bit when dumping them to the surface? Or are the surfaces actually 24bit, but when blitted convert to 16bit?