Anders Melander, who wrote the original TGIFImage, has the following answer.
You need to add a “Netscape Loop” extension block to the first frame of your GIF.
The loop block must be the first extension you define for the frame or else it will not work.
See the Animate demo for an example of how to build an animated GIF.
Here is a code excerpt from the Animate demo:
// Add the source image to the animation
Result := GIF.Add(Source);
// Netscape Loop extension must be the first extension in the first frame!
if (GIF.Images.Count = 1) then
begin
LoopExt := TGIFAppExtNSLoop.Create(Result);
LoopExt.Loops := 0; // Number of loops (0 = forever)
end;
You can view the TGIFImage documentation here.