Palette creation failure.................... 
Author Message
 Palette creation failure....................

Howdy there folks

I am trying to build a 256 color palette with custom colors and am
having major problems getting it to be realized.  I have followed the
examples in MSDN but to no avail.  The colors come back dithered and
the palette modifications are not detectible.  Help!  We have to get
these colors working.

Kevin Cranston



Mon, 30 Aug 1999 03:00:00 GMT  
 Palette creation failure....................

Did you call RealizePalette()?  If you didn't, that would cause the
problem.  If you did, did you set the palette as the foreground palette
when you are drawing?  (You probably did, since that is the default.)  If
the window you are drawing into is the topmost window (with the focus) and
you still get dithering the palette may be full).

I suggest you check out the excelent CDib example by Jeff Prosise in the
February issue of MSJ.  He covers a lot of these issues.  The best
discussion of palettes for Windows programming I have seen is in the book
'Animation Techniques in Win32' by Nigel Thompson.
--
Ed



Quote:
> Howdy there folks

> I am trying to build a 256 color palette with custom colors and am
> having major problems getting it to be realized.  I have followed the
> examples in MSDN but to no avail.  The colors come back dithered and
> the palette modifications are not detectible.  Help!  We have to get
> these colors working.

> Kevin Cranston




Tue, 31 Aug 1999 03:00:00 GMT  
 Palette creation failure....................

Quote:

> I am trying to build a 256 color palette with custom colors and am
> having major problems getting it to be realized.  I have followed the
> examples in MSDN but to no avail.  The colors come back dithered and
> the palette modifications are not detectible.

Assuming your palette creation completes successfully, you also have to
select it into your DC prior to drawing and realize it, and you must
handle WM_QUERYNEWPALETTE and WM_PALETTECHANGED in every top-level
window that needs to use your custom palette.  -steve
--
McAdams Research
MFC GUI Toolkit [http://home.sprynet.com/sprynet/smcadams]


Wed, 01 Sep 1999 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Palette creation failure....................

2. Help - Palette Creation

3. CSocket creation failure

4. Document creation failure.

5. Creation failure with CImageList.....What the...???

6. CBitmap creation failure

7. Document creation failure.

8. WebBrowser Creation Failure!

9. DUMP GIF PALETTE Palette Routine Please !

10. Color Palette

11. Need help with palette dump !

12. Get palette colors using the _inp port function

 

 
Powered by phpBB® Forum Software