![]() |
| | #1 |
| Registered User Join Date: Oct 2002
Posts: 4
| "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;
}
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;
Code:
pPal->palPalEntry[ndx].peRed = pColorTab[ndx].rgbRed;
pPal->palPalEntry[ndx].peGreen = 0;
pPal->palPalEntry[ndx].peBlue = 0;
pPal->palPalEntry[ndx].peFlags = NULL;
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 |
| colinH is offline | |
| | #2 |
| UNBANNED Join Date: Jan 2002
Posts: 669
| It looks like what you've tried should have worked, maybe try a different colour. Try Blue or Green instead of Red, I think red holds most of the information in an image so you may not see much of a diff in pic quality. You should see the same pic, only shaded the colour you have selected.
__________________ My Avatar says: "Stay in School" Rocco is the Boy! "SHUT YOUR LIPS..." |
| OneStiffRod is offline | |
| | #3 |
| Registered User Join Date: Sep 2002
Posts: 417
| What compiler are you using? I want to look into 256 colors for Microsoft Visual C++ 6.0's dos consoles.... I don't think there is anything that simple. |
| Trauts is offline | |
| | #4 |
| Registered User Join Date: Oct 2002
Posts: 4
| I am using the MSVC++ 4.0 developer studion standard. I obviously am new to this, but I would have thought setting just one colour would work. I just wonder if, for some reason, the wrong palette is being selected or overwritten. However, I have to assume the code in the tutorial is correct. I've looked through the sample programs but cannot find anything of help. FYI i'm running the software on a NT4.0 SP6a |
| colinH is offline | |
| | #5 |
| Registered User Join Date: Oct 2002
Posts: 4
| Actually, it gets more confusing, I just modified the section to this... Code: for( int ndx = 0; ndx < cPaletteEntries; ndx++ )
{
pPal->palPalEntry[ndx].peRed = 12;
pPal->palPalEntry[ndx].peGreen = 0;
pPal->palPalEntry[ndx].peBlue = 0;
pPal->palPalEntry[ndx].peFlags = NULL;
}
If anyone can clear this up I'd really be grateful. |
| colinH is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problem running a Cboard C++ tutorial! | Monkey Liar | C++ Programming | 6 | 02-15-2002 03:32 AM |
| MSVC and ATL problem | Unregistered | Windows Programming | 1 | 01-22-2002 07:07 AM |
| MSVC problem just started | Eber Kain | C++ Programming | 2 | 11-30-2001 04:32 PM |
| problem with output | Garfield | C Programming | 2 | 11-18-2001 08:34 PM |
| SDI Menu problem - Windows MSVC 6.0 | Brown Drake | C++ Programming | 0 | 10-13-2001 06:04 AM |