CONVERT RGBX to RGBTRIPLE
C / C++ / MFC
1
Posts
1
Posters
0
Views
1
Watching
-
HI, I wrote a following code to retrive RGBX bits from a bitmap, but does anyone know how to retive RGBTRIPLE bits using GETDIBits? THanks BITMAPINFO bi; int height = Get_Bitmap_Info(bi); if (!height) return FALSE; BYTE* p_bits = (BYTE*)new BYTE[bi.bmiHeader.biSizeImage]; HDC hdc = GetDC(NULL); if (!GetDIBits(hdc, (HBITMAP)GetSafeHandle(), 0, height, p_bits, &bi, DIB_RGB_COLORS)) { delete p_bits; p_bits = NULL; } ::ReleaseDC(NULL, hdc); return (RGBX*)p_bits;