I've been digging through deja/google for days trying to figure out what
the best approach to this Delphi programming problem is... Here's what
I want to do in D4:
1. In some display mode > 8 bits (16 or 24 bits/pixel).
1. Load a GIF
2. Display the GIF, and a second pane of some sort with the (up to) 256
colors of the GIF palette.
3. Provide for editing/mods of the GIF palette, individual colors, or
palette operations (reverse colors, generate a spread from one color
to a second, etc), such that when the mods are performed, the effect on
the image is displayed.
4. Save the GIF out as a Gif with the newly modifed palette.
I've got TGIFImage, which seems to load and display the image fine, but
from there things are just confusing. It looks like every version of
Delphi may operate different in that regard, and there is an assortment of
badly documented component libraries none of which are obviously the right
ones to use for this sort of thing.
I gather I'll need to load the image to a DIB, and somehow connect that
to an actual display component to cause a DIB to DDB translation to occur
for the display. Then perhaps I can get the colortable in the DIB and
modify it for subsequent re-display and GIF saving.
Is this the right approach? If it is, then how do I accomplish the
1. Load a GIF into a DIB. Anyone know if TGIFImage can be used or do I have
to resort to something else? Or maybe I can use TGIFImage as is and
somehow get at an internal DIB it may be maintaining? TGIFImage just
seems to extend the Image component so that you can load GIF images just
like BMPs or JPGs-- there is no TGIFImage component, it just extends the
2. Get the ColorTable from the DIB.
3. Update the displayable component (map to the DDB and then update the
4. Save the GIF from a DIB with the new ColorTable.
Any ideas, pointers, sample code, special components, or cautions anyone
may be willing to offer would be appreciated. The Web/dejagoogle has been
a morass of hundreds of independent, incomplete, somewhat conflicting or
related to other Delphi versions that don't seem quite on target. It
seems like a rather simple program on the surface...
Keith Doyle <http://www.syncopator.com/carousel>
(to send me an E-letter, remove underbars in reply address)
"Complexity is easy; simplicity is hard." --Edmund Kean(?)