TImage Bitmap.Vertual Part 2

Part 2.

The question still stands.

I would like to access the true palette of an image without touching the windows colour palette. Can this be done!  I'v tryed different ways and still I miss something.  I remember I found some place that an expert had a way to access the images true colour at a certin pixel, but did not give how this was done and I can't find that question.

The reason for this is I am trying to make a specal text to graphic(Pixel) Code program.  To retain the information for me and my friends to see.  I know I could encript the text but I had something like this working on the AMIGA Systems.  It is what I need for a program I'm working on to Graphic/text the data files for it.
Who is Participating?
mheacockConnect With a Mentor Commented:
Found this in the help file under TColor:

"If the highest-order byte is zero ($00), the color obtained is the closest matching color in the system palette. If the highest-order byte is one ($01), the color obtained is the closest matching color in the currently realized palette. If the highest-order byte is two ($02), the value is matched with the nearest color in the logical palette of the current device context."

Check the high byte and set accordingly...I haven't tested
this...but it is worth a shot.  Grade or reject accordingly.

Thank you for inviting me to answer this question...but I
think I will pass.

Why?  I hate paletting.  It is a gigantic pain in the ass.
And besides, I think it is now becoming a thing of the past.
Why?  4MB video cards (true colour at 1280x1024) are now
dirt cheap.

Anything I write now requires true colour.  I don't write
programs for your regular home user, thus I can do make
this requirement.

You might want to rethink what you are doing and see if you can
make the same requirement.
If you load a bitmap into a TBitmap, all the colours in the
TBitmap will be mapped to the bitmaps palette.  That's if you
are loading a 256 colour bitmap.

If you load a true colour bitmap into a TBitmap, the colours
should not be mapped until it is displayed in a TImage.

But like I said, I don't do paletting anymore and don't have
the time to test.  I may be wrong.  If I am then this is a
shortcoming of Delphi...it should not map true colour bitmaps
until they are copied into a Display Context (DC).

Anyhow, I hope someone else can answer this question more
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

PPaulAuthor Commented:
Thanks for the time and thanks for the help.  I did look into other areas and found another way with the 16 colour that is the windows defults.  It's not what I was looking for but it is close.

Here's how I did it..

I asign a 'array of string'  from 0 to 15. I then enerted the String vales that delphi understands

Ex.: 'clRed'

On the writing of a letter it evaluates the ascii code of the letter and then breaks it down.

 a = 34. Convert the Integer to a string and get '34', add a '0' in front and get '034'.  I then break that into 3 parts that each coaspond to a number in the array of string list.

0= clBlack
3= clOlive
4= clNavy

I use this to change the pixels color with the pixels command.
When I read the same pixel I revers the proccess and get the letter I started with.

I still would like help on the abily to use he full true color range.  If any one out ther can improve on this please talk to me.

I thanks once more, mheacock,  for the time you sepent on the subject. I did learn somethin from it.
PPaulAuthor Commented:
I did see that in the delphi help way befor I came here for some help. (I do my reserch!) I tested it and I still got the window palette.  I just relised that a 255 color pattet has to be created for it to use $02.  I'm currently doing test with the relize pallete.  I'm not sure but when relizing a palette, does it take it as you statted.  Well I'll wait for an anaswer for a couple of days and then I'll grade you.  (and it will be good+.)  If you want to see the demo that I have, I can E-Mail you a copy!  And if you want to see the sorce code for it just stat it.


How much code is there to look at at?  I don't have a lot of
time...what the heck...mail any way...

Code and program...


I'll try to help...ack!  :)  :)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.