Here is how I set up the structure for a 24 bits 256x256 bitmap:
HBITMAP bitmap = LoadBitmap(GetModuleHandle(NULL),MAKEINTRESOURC (IDB_BITMAP7));unsigned char data[256*256*3]; BITMAPINFO info; BITMAPINFOHEADER header; header.biSize = sizeof(BITMAPINFOHEADER); header.biWidth = 256; header.biHeight = 256; header.biPlanes = 1; header.biBitCount = 24; header.biCompression = BI_RGB; header.biSizeImage = 0; header.biClrUsed = 0; header.biClrImportant = 0; info.bmiHeader = header; info.bmiColors->rgbRed = NULL; info.bmiColors->rgbGreen = NULL; info.bmiColors->rgbBlue = NULL; info.bmiColors->rgbReserved = NULL; HDC hdc = GetDC(g_App.m_hWndRender); GetDIBits(hdc, bitmap, 0, 256, &data, &info, DIB_RGB_COLORS); ReleaseDC(g_App.m_hWndRender, hdc);
Gandalf the White
Edited by - Gandalf on June 22, 2000 4:47:40 AM
Edited by - Gandalf on June 22, 2000 4:48:30 AM
Edited by - Gandalf on June 22, 2000 5:20:05 AM