68 Info = (BITMAPINFO *)
new char [
sizeof(BITMAPINFO) + 256*
sizeof(RGBQUAD)];
76 Info->bmiHeader.biSize =
sizeof(BITMAPINFOHEADER);
77 Info->bmiHeader.biWidth = width;
78 Info->bmiHeader.biHeight = -height;
79 Info->bmiHeader.biPlanes = 1;
80 Info->bmiHeader.biBitCount = 8;
81 Info->bmiHeader.biCompression = BI_RGB;
82 Info->bmiHeader.biSizeImage = 0;
83 Info->bmiHeader.biXPelsPerMeter = 0;
84 Info->bmiHeader.biYPelsPerMeter = 0;
85 Info->bmiHeader.biClrUsed = 256;
86 Info->bmiHeader.biClrImportant = 256;
89 for (
int i=0; i<256; i++) {
90 Info->bmiColors[i].rgbBlue = (
unsigned char)pal[i].Get_Blue();
91 Info->bmiColors[i].rgbGreen = (
unsigned char)pal[i].Get_Green();
92 Info->bmiColors[i].rgbRed = (
unsigned char)pal[i].Get_Red();
93 Info->bmiColors[i].rgbReserved = 0;
97 HDC hdc = GetDC(hwnd);
98 Handle = CreateDIBSection(hdc, Info, DIB_RGB_COLORS,(
void**)&Pixels,
NULL, 0);
106 Width = Info->bmiHeader.biWidth;
107 Height = abs(Info->bmiHeader.biHeight);
108 Pitch = (Width + 3) & 0xfffffffC;
112 if (Info->bmiHeader.biHeight > 0) {
115 PixelBase = (Pixels + (Height - 1) * Width);
126 int surfwid = abs(Pitch);
127 Surface =
new BSurface(surfwid,Height,1,Pixels);
129 if (Surface ==
NULL) {