Delphi TImage Loading GIF Bad Qality

326 Views Asked by At

While a process is running in the background, I show a loading animation on the screen. But the GIF looks very bad quality. How can I fix this problem?

unit Unit3;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
  System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.Imaging.GIFImg, Vcl.ExtCtrls,
  Vcl.StdCtrls;

type
  TForm3 = class(TForm)
    Image1: TImage;
    procedure FormShow(Sender: TObject);

  private
    { Private declarations }
  public
    { Public declarations }
  var
    sFile: string;
  end;

var
  Form3: TForm3;
  aGIF: TGIFImage;
  bmp:TBitmap;

implementation

{$R *.dfm}

procedure TForm3.FormShow(Sender: TObject);

begin
  aGIF := TGIFImage.Create;
  aGIF.LoadFromFile(sFile);
  aGIF.Animate := True;
  Image1.Picture.Assign(aGIF);
  aGIF.Free;
end;

end.

image

0

There are 0 best solutions below