Skip to main content
gamedev.net
🔒 Locked

CreateDIBSection Returning 0

Started by squicklid May 5, 2004 at 6:02 PM 2 replies 450+ views
Original Post
squicklid
squicklid
Here''s my setup:
BYTE *bits;
BITMAPINFO bmi;

bmi.bmiHeader.biBitCount = 24;
bmi.bmiHeader.biClrImportant = 0;
bmi.bmiHeader.biClrUsed = 0;
bmi.bmiHeader.biCompression = BI_RGB;
bmi.bmiHeader.biHeight = 100;
bmi.bmiHeader.biWidth = 100;
bmi.bmiHeader.biPlanes = 1;
bmi.bmiHeader.biSize = 0;
bmi.bmiHeader.biSizeImage = 0;

HDC tmpDC = GetDC(NULL);
hbmp = CreateDIBSection(tmpDC, &bmi, DIB_RGB_COLORS, (LPVOID *)bits, NULL, 0);

ReleaseDC(NULL, tmpDC);
 
but CreateDIBSection returns 0, and I can''t do anything with that.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.