Delphi TGIFImage animation issue with some GIF viewers

后端 未结 2 2140
闹比i
闹比i 2021-02-20 08:02

I have discovered that animated GIFs created using Delphi 2009\'s TGIFImage sometimes doesn\'t play correctly in some GIF viewers. The problem is that the

2条回答
  •  逝去的感伤
    2021-02-20 08:24

    Edit: This turned out not to be the answer but I'm keeping it as the rule about the loop extension still applies.


    The NETSCAPE loop extension must be the first extension:

    var
      Frame: TGIFFrame;
    ...
    for i := 0 to 499 do
    begin
      MakeFrame(i);
      Frame := g.Add(bm);
      if (i = 0) then
        TGIFAppExtNSLoop.Create(Frame).Loops := 0;
      TGIFGraphicControlExtension.Create(Frame).Delay := 3;
      Writeln('Creating frame ', i+1, ' of 500.');
    end;
    

    See: The TGIFImage FAQ.

    Apart from that I see nothing wrong with your GIF, but you could reduce the size a bit with a global color table.

提交回复
热议问题