16 colour Windows palette

16 colour Windows palette

Post by j.. » Thu, 11 Jul 1996 04:00:00



Does anybody have any experience working with the fixed 16 colour
windows palette?
I'm trying to work with photoshop but am having big trouble trying to
keep the palette consistent with the bog standard 16.....

 
 
 

1. 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

2. AVI codecs (again)

3. Creating graphics for 16 Color MS-Windows Palette

4. Death of Commodore (and Amiga / Toaster?)

5. Converting a grey palette to a colour palette ?

6. Converting screen coords to world coords

7. 16 colour problem

8. bloomer plugins

9. Only 16-bit colour on I2 H.I.?

10. What's 16 bit colour?

11. Fast transparency effects in 16-bit colour