We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now



remcodek asked
Medium Priority
Last Modified: 2010-04-06
I'd like to have info on handling (logical) palettes in the Windows-environment. My Delphi-package came with the 21-day course which says very little about this. I'd like to know how to use CreatePalette, RealizePalette etc. and the difference between Delphi's PaletteRGB and RGB.
Watch Question

You should take a look at the help files that come with Delphi for these palette functions. And I also suggest you to take a look at the following files (examples using palette functions):
- DIBDemo2.zip in DSP
- www.tempest-sw.com/freeware/Delphi/pal10.zip

Hope this helps


Imagine: I looked in Delphi's help-files!
They helped me no further. The Windows-help-files gave me some more info but not enough to work on. I fooled around a bit with some of the functions but with very little succes.

As for background: I'm used to do palette-stuff in a DOS-environment, which gives you clear and simple acces to the full palette.

I can give you answer later...but for now...consider this...

Paletting is already becoming a thing of the past.  4MB
video cards are dirt-cheap now.  If you are designing a game,
state a requirement of TRUE COLOUR.  There are very few games
on the market, nowadays, that are written for the lowest common

Palettes are a true pain in the ass.  If you can afford it,
and you think it won't affect the overall distribution of
you application, I'd suggest just doing everything in TRUE
COLOUR and avoiding the entire paletting mess.

But if you REALLY REALLY want palette tips, then I suppose I
can try and give you a few.  But be warned...paletting is
a real pain in the butt and many frustrating sessions will
be spent debugging.

Listen to mheacocks's advice !!

Palettes are much more complicated in windows than in dos !!

In dos you are running a single app with a single palette. In windows all apps share the same colorspace and palettes are synchronized to use the same colors, etc. to get maximum efectiveness over all applications. This complicates both the implementation and handling of palettes in windows as opposed to dos.



I ask the way to the Tower Bridge and all I get as a reply is "Don't go there."
Why do you think I ask this question?

To be a bit more specific: I'm used to doing programs in DOS fiddling with palettes all the time, I've written a few Windows-applications some in truecolor some with a single palette but now I'm faced with the fact that I need to write a program that has to be able to run on systems with only 256 colors.
(Don't ask me why, let's just say there are a lot of users that can't afford to buy new equipment every two or three years).

Tell me it's impossible and I'll stop my search, but saying it's too difficult is not enough.
I've struggled through the Win32-help-docs but they tell me lots of stuff but don't give ANY example as to how to use that information.

By the way, can anyone tell me: does it actually make sense trying to program in 256 colors (in Windows that is)?

Thanks anyway!

Remco de Korte

I didn't say "Don't go there"...but I do suggest avoiding the
Tower Bridge if you can.

A couple of years ago, you had to program for 256 colours...
True Colour video cards that supported the higher resolutions
were expensive...now they are cheap...very few package systems
are being offered with video cards that do not support true
colour at 1024x756 (or higher).

So, nowadays, it does not make sense to program in 256 colour.
But if you have to you have to, therefore I will try and dredge
up some examples for you over the next few days.



Okay, thanks (in advance).

I understand truecolor is the standard now.
That's also part of the problem. I have to reset my display everytime I want to testrun a program in 256 colors.
Still, also for web-pages 256-color seem to be recommended.
Also, I found that several people buy brandnew systems that have a display  set at 256 colors (even though it supports hicolor) and don't have a clue about this or changing it.

But, again, if you could dig up some (not too complicated) examples with Createpalette and the likes (maybe some info on DC's - I'm not too familiar with that concept either) I'd be grateful.
I know it might be asking a bit much and I didn't want to seem ingrateful with my Tower Bridge, it's just that this problem is really nagging me. (I'll add some points as a bonus, that should make up for it)


I'm not going to paste a whole lot of code here, but if you want me to send you a sample Delphi 1.0 application that demonstrates Palette animation, I can send it to you.

And for those people that are reading this as a PAQ...so you don't feel cheated for having just spent 15 points, you can mail me too and ask for the code.

My e-mail is:  cerebus@islandnet.com

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Did this help?  If you could grade this it would be appreciated.  Thanks.  If you need further assistance, just add a comment and I will answer shortly.  I don't think you've mailed me for the app.


It's rather difficult to grade an answer I have yet to get but I'll leave it at this as this is obviously such a difficult question (?).
I guess I'll figure it out myself from the examples I can collect but I was hoping there would be someone here that could provide me with some theory-to-practice information on palettes.

Please send me the examples (eventhough I use Delphi20 - it must be ok (?)) and thanks for your efforts.


You didn't have to grade until you got the examples...I mainly wanted to know if you wanted the examples...I need you to mail me, so that I can send you the examples...they will work in Delphi 1.0.  My e-mail address is above.


Never mind...


The examples was stuff I got off the net last summer, so you probably found the examples yourself.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.