51 Info = (BITMAPINFO *)
new char [
sizeof(BITMAPINFO) + 256*
sizeof(RGBQUAD)];
59 Info->bmiHeader.biSize =
sizeof(BITMAPINFOHEADER);
60 Info->bmiHeader.biWidth = width;
61 Info->bmiHeader.biHeight = -height;
62 Info->bmiHeader.biPlanes = 1;
63 Info->bmiHeader.biBitCount = 8;
64 Info->bmiHeader.biCompression = BI_RGB;
65 Info->bmiHeader.biSizeImage = 0;
66 Info->bmiHeader.biXPelsPerMeter = 0;
67 Info->bmiHeader.biYPelsPerMeter = 0;
68 Info->bmiHeader.biClrUsed = 256;
69 Info->bmiHeader.biClrImportant = 256;
72 for (
int i=0; i<256; i++) {
73 Info->bmiColors[i].rgbBlue = (
unsigned char)pal[i].Get_Blue();
74 Info->bmiColors[i].rgbGreen = (
unsigned char)pal[i].Get_Green();
75 Info->bmiColors[i].rgbRed = (
unsigned char)pal[i].Get_Red();
76 Info->bmiColors[i].rgbReserved = 0;
80 HDC hdc = GetDC(hwnd);
81 Handle = CreateDIBSection(hdc, Info, DIB_RGB_COLORS,(
void**)&Pixels,
NULL, 0);
89 Width = Info->bmiHeader.biWidth;
90 Height = abs(Info->bmiHeader.biHeight);
91 Pitch = (Width + 3) & 0xfffffffC;
95 if (Info->bmiHeader.biHeight > 0) {
98 PixelBase = (Pixels + (Height - 1) * Width);