Article View: comp.os.ms-windows.programmer.misc
Article #2393Bitmaps and palettes
From: Alasdair Mackintosh
Date: Tue, 26 Jan 1993 19:01
Date: Tue, 26 Jan 1993 19:01
42 lines
2125 bytes
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
Technical Details
Message-ID:
<1993Jan26.120129.2836@ug.eds.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!ug.eds.com!ug.eds.com!mackintoshShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!ug.eds.com!ug.eds.com!mackintosh Newsgroups: comp.os.ms-windows.programmer.misc Subject: Bitmaps and palettes Message-ID: <1993Jan26.120129.2836@ug.eds.com> From: mackintosh@ug.eds.com (Alasdair Mackintosh) Date: 26 Jan 93 12:01:29 PDT Reply-To: mackintosh@ug.eds.com (Alasdair Mackintosh) Distribution: world Organization: EDS Unigraphics, Cypress CA Nntp-Posting-Host: 134.244.49.167 Lines: 43