?
Solved

TImage Bitmap.Vertual Part 2

Posted on 1997-07-05
6
Medium Priority
?
173 Views
Last Modified: 2012-05-04
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
Comment
Question by:PPaul
[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
  • 4
  • 2
6 Comments
 
LVL 3

Expert Comment

by:mheacock
ID: 1338256
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
 
LVL 3

Expert Comment

by:mheacock
ID: 1338257
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
 

Author Comment

by:PPaul
ID: 1338258
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's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 3

Accepted Solution

by:
mheacock earned 800 total points
ID: 1338259
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
 

Author Comment

by:PPaul
ID: 1338260
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
 
LVL 3

Expert Comment

by:mheacock
ID: 1338261
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying 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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

719 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