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.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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):
- in DSP

Hope this helps
remcodekAuthor Commented:
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.
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

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.
remcodekAuthor Commented:

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 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.
remcodekAuthor Commented:

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 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:

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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.
remcodekAuthor Commented:
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.
remcodekAuthor Commented:
Never mind...
The examples was stuff I got off the net last summer, so you probably found the examples yourself.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.