MSVC Tutorial problem - Monochrome Palette
The exercise states:
"Modify the CBmpPalette class used in the Dib example so that it is monochromatic, with only various shades of one color selected for the palette instead of colors from the bitmap."
In my naiveté I had presume I simply set all of the RGB's to one - thus...
From..
Code:
for( int ndx = 0; ndx < cPaletteEntries; ndx++ )
{
pPal->palPalEntry[ndx].peRed = pColorTab[ndx].rgbRed;
pPal->palPalEntry[ndx].peGreen = pColorTab[ndx].rgbGreen;
pPal->palPalEntry[ndx].peBlue = pColorTab[ndx].rgbBlue;
pPal->palPalEntry[ndx].peFlags = NULL;
}
to....
Code:
pPal->palPalEntry[ndx].peRed = pColorTab[ndx].rgbRed;
pPal->palPalEntry[ndx].peGreen = pColorTab[ndx].rgbRed;
pPal->palPalEntry[ndx].peBlue = pColorTab[ndx].rgbRed;
pPal->palPalEntry[ndx].peFlags = NULL;
or maybe
Code:
pPal->palPalEntry[ndx].peRed = pColorTab[ndx].rgbRed;
pPal->palPalEntry[ndx].peGreen = 0;
pPal->palPalEntry[ndx].peBlue = 0;
pPal->palPalEntry[ndx].peFlags = NULL;
but this still ends up with a full 256-colour image.
The text as you can see does not clarify how it could be done. Can anyone show where I may be going wrong?
If you simply quote the class/procedure and whre I amy make changes it would help tremendrously.
Many thanks,
-Colkai