🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.os.ms-windows.programmer.misc
1 messages
1 total messages Started by Alasdair Mackintosh Tue, 26 Jan 1993 19:01
Bitmaps and palettes
#2393
Author: Alasdair Mackintosh
Date: Tue, 26 Jan 1993 19:01
42 lines
2125 bytes

  I'm trying to use AnimatePalette to change the colours on the  screen. I've 
  got a dialog that allows you to edit the colours in the logical palette, and 
  this works fine with the colours that I've drawn, but it doesn't work with
  a bitmap.

  Here's what I've done (using TC++ and OWL):

  1) Create a logical palette.

  2) When I set up my main window, I create a memory display context (using
     CreateCompatibleDC), create a bitmap, and select it into the memory
     display context. (This memory DC has the same number of bits-per-pixel
     and color planes as the original screen DC.)

  3) I draw onto the screen DC using SetPixel, and also using FillRectangle.
     In each case, I use PALETTEINDEX to get a COLORREF value for drawing with.

  4) I also draw onto the bitmap (via the memory DC) using exactly the same 
     function calls. I then transfer the bitmap onto the screen using BitBlt.

  5) My Paint member function does this as well (ie draws onto the bitmap,
     and draws onto the screen.)


  When I run my dialog, (which calls AnimatePalette to change the colours) the
  rectangels/pixels that I've drawn directly onto the screen change colour. But,
  the stuff that was drawn onto the bitmap doesn't change.

  Any ideas?

  P.S. I don't have the code in front of me - I may have mispelled some of the
  function names.



--
===============================================================================
Alasdair Mackintosh                             mackintosh@ug.eds.com
Unigraphics Division                            (714) 952-5698
Electronic Data Systems                         10824 Hope St, Cypress CA
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads