Problems with bitmap and palette
Posted on 1998-09-08
I'm developing an application using MSVC++ 4.0 and MFC. There should appear a picture when I run the application during some seconds. I've scanned two pictures: one of 16 colors and other one of 256 colors for each display configuration.
The code on the OnPaint routine is:
// get information about video mode
int i, j, k;
i = dc.GetDeviceCaps(BITSPIXEL);
j = dc.GetDeviceCaps(PLANES);
k = dc.GetDeviceCaps(NUMCOLORS);
//deletes the resource used to initialize the CBitmap object
if ( (i==1) && (j==4) && (k==16) )
resource = IDB_SPLASH16; // 16 colors
resource = IDB_SPLASH; // 256+ colors
// Paint the image.
CBitmap* pOldBitmap = dcImage.SelectObject(&m_bitmap);
dc.BitBlt(0, 0, bm.bmWidth, bm.bmHeight, &dcImage, 0, 0, SRCCOPY);
I'm having problems with the picture shown. The same picture that I visualize in the Photo Paint software looks different that when I visualize it as an open picture (it seems to loose colors). I don't know if I should initialize the palette or change its order. Is there any special configuration for the palette in order to make it work? Anyway, is it a problem with the palette? Else, is it an MFC problem or a graphical problem?