Solved

palette-info

Posted on 1997-03-26
14
307 Views
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.
0
Comment
Question by:remcodek
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
14 Comments
 
LVL 2

Expert Comment

by:javiertb
ID: 1334971
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
0
 

Author Comment

by:remcodek
ID: 1334972
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.
0
 
LVL 3

Expert Comment

by:mheacock
ID: 1334973
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
denominator.

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.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Expert Comment

by:gysbert1
ID: 1334974
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.
0
 

Author Comment

by:remcodek
ID: 1334975

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
0
 
LVL 3

Expert Comment

by:mheacock
ID: 1334976
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.
0
 

Author Comment

by:remcodek
ID: 1334977

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)

Bye,

Remco
0
 
LVL 3

Accepted Solution

by:
mheacock earned 150 total points
ID: 1334978
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
0
 
LVL 3

Expert Comment

by:mheacock
ID: 1334979
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.
0
 

Author Comment

by:remcodek
ID: 1334980
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.

Remco
0
 
LVL 3

Expert Comment

by:mheacock
ID: 1334981
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.
0
 

Author Comment

by:remcodek
ID: 1334982
Never mind...
0
 
LVL 3

Expert Comment

by:mheacock
ID: 1334983
Whatever.
0
 
LVL 3

Expert Comment

by:mheacock
ID: 1334984
The examples was stuff I got off the net last summer, so you probably found the examples yourself.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question