Link to home
Start Free TrialLog in
Avatar of andrewk032397
andrewk032397

asked on

Creating and Using a Palette

I need some code explaining how to:
1) Create a palette of colours for use with a TImage object.
I'll basically be plotting pixels on the canvas of the TImage.
2) Alter the palette
3) Save / Load it.

All I really need is some code with comments and I'll be able to figure it out.
Thanks, Andrew
Avatar of javiertb
javiertb

You should take a look at the file DIBDemo2.zip at Delphi Super Page, but I guess you'll have to deal with these functions: SelectPalette, CreatePalette,RealisePalette and UpdateColors (you'll find more about then in the help documents).

Hope this helps.
What do you want to do with the application ?

Do you really need access to the palette ?

If you use TImage.create you can create an Image (with a canvas and a palette) on which you can plot pixels, access and modify the palette and save the image ...
I've tried working with palettes at length ( D1 ). I managed to get objects to draw in the colour I wanted, but only if you had one on the screen at once! I'd be VERY interested to know if you ever manage to get it working properly!
ASKER CERTIFIED SOLUTION
Avatar of gysbert1
gysbert1

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial