Manipulating a bitmap's palette for 3D rendering

I'm a beginner with Delphi.

I'm writting a simple 3D rendering program.  I have just finished implementing color shading of objects (Gouraud and Phong) and they both seem to work fine, except for one little snag.  The number of shades for one color is very limited.  Right now, I render the object on a pixel by
pixel basis meaning that the RGB value is calculated for each pixel.  After translating the RGB values to TColor type, I use:
  MyBitmap.Canvas.Pixels[x,y] := <some RGB style number>;

At this point, I believe it is Windows that selects the nearest color in the system palette (or does it come directly out of the bitmap palette... can you tell that I really am not familiar with palettes?? :) and uses IT instead of the calculated color to display on the bitmap.
Now since the system palette does not contain many shades of, let's say blue in my case (I think there were about 4 or 5 in the tested rendered images), the rendered image doesn't look that great.  The moral of this story is: How do I manipulate the system palette (or is it the bitmap palette) to increase the number of shades of a given color? and
furthermore Is there a simple way of having Delphi (or Windows) maximize the use of the palette by selecting appropriate shades?  What units do I need to include?

I fear that the answer to this last part (about maximizing the palette use) is no... if such is the case, are there any libraries available that will do this for me?  (preferably free :)

Even just pointing me to appropriate reading material would be greatly appreciated.  

many many thanks in advance,

Dali
daliAsked:
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.

mheacockCommented:
I would suggest getting a good API book.  The Win32 API Bible by the Waite Press has an excellent palette section.  It will tell you how to make a palette...you can then assign this palette you make to the palette of your form's canvas...Delphi will then handle the rest of the palette relaizations and such.
0

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
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
Fonts Typography

From novice to tech pro — start learning today.

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.