Reputation: 811
I download a animated GIF file from . The following the instructions in How to use Animated Gif in a delphi form to play it. But what I see is always a white block without any animation. Why?
Let me describe the process in details:
When I try to add the animated GIF, I see the following screen:
After clicking "OK" button, I will see below:
The whole project(Delphi 10.3) is at https://www.dropbox.com/s/jbsj86fgpq6qkpi/TestGIF.zip?dl=0
The related codeline is only below:
procedure TForm1.Button1Click(Sender: TObject);
begin
(Image1.Picture.Graphic as TGIFImage).Animate := True;
( Image1.Picture.Graphic as TGIFImage ).AnimationSpeed:= 500;
end;
More information:
Upvotes: 2
Views: 1106
Reputation: 21045
It was not before I downloaded the image you referred to, that I could reproduce the problem.
The reason, (at least the only way I could reproduce the "error"), is that the TImage
at the default designer size is 105 x 105, in which case it shows a part (top-left) of the image. The image is 630 x 637, and the visible part shown in the TImage
is the top-left white area, where the spinner never draws.
The simple correction is to set the Proportional
property True
Note also, that the picture editor window does scale the image to fit in its viewport.
Upvotes: 3