Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 177
  • Last Modified:

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.
0
PPaul
Asked:
PPaul
  • 4
  • 2
1 Solution
 
mheacockCommented:
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.
0
 
mheacockCommented:
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
thoroughly.
0
 
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.

 Ex.:
 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.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

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

Cheers,
0
 
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.

thanks.

0
 
mheacockCommented:
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...

cerebus@islandnet.com

I'll try to help...ack!  :)  :)
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now