View Full Version : RGBA Bitmap ?

07-01-2004, 07:12 AM
I do my rendered in Bitmap because I work with big rendered pictures (as 4096x4096).

So, I do that :

// ----------------------------------------
void* pBits;

BITMAPINFO bmpInfo = { { sizeof(BITMAPINFOHEADER), w, h, 1, 32 } };

hBmp = CreateDIBSection(NULL, & bmpInfo, DIB_RGB_COLORS, & pBits, NULL, NULL);

hdc = CreateCompatibleDC(GetDC(GetDesktopWindow()));

SelectObject(hdc, hBmp);

hrc = wglCreateContext(hdc);


I can read result pixels avec "pBits[x+y*W]". I have RGB bits but not Alpha bits ! I need RGBA bits.

Note : I know glReadPixels (that return correct RGBA bits). I search a another way. I search a way where there is only one result (not in bitmap data + in "glReadPixels" data)

My question :
What is the best way to do a rendered of RGAB Bitmap ?