Controls prefer 16 colour to logical palette
Palette gurus,
I have a form with a number of controls. The controls are colored in colors
that are in the logical palette that I have created, _however_ the controls
don't display using this palette, they just dither from the 16 color
palette.
Questions:
1) How do I make a control use a color in the logical palette?
The following picks up the correct palette index...
GetNearestPaletteIndex(fLogicalPalette,COLORREF(Shape1->Brush->Color))
... but I don't know how to correctly assign this color to the control.
Interestingly though is that
GetNearestColor(hDC, COLORREF(Shape1->Brush->Color))
returns one of the 16 colors even though the system pallette does contain
the required color.
2) I am aware that an old trick is to display a bitmap on the form
containing all the required colors, that way any controls needing those
colors will see that they are available and won't dither from the standard
set of 16. Well, I tried this and it didn't work, although the bitmap looked
great :-(
3) I'm not Robinson Crusoe on this one, so is there a reference/resource I
can use to help my tired brain? My approach so far has been a 5-day exercise
in Windows palette manipulation, writing what looks a lot like Windows
Petzold Hieroglyphics than elegant BCB.
Thanks in advance
Garron