请问用delphi7的image之Timage,怎么显示动图gif?
抄了两段,一段是调开关速度,另一段指向图片。拼接起来无法执行成功
用属性picture的图片选择,里面没有gif选择。
请问这个怎么处理显示呢?(或者有历史老代码的阅读空间)
- unit Unit1;
-
- interface
-
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, ExtCtrls;
-
- type
- TForm1 = class(TForm)
- Image1: TImage;
- procedure Image1Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
-
- var
- Form1: TForm1;
-
- implementation
-
- {$R *.dfm}
-
- procedure TForm1.Image1Click(Sender: TObject);
- begin
-
- image1:timage;
- image1:picture.loadfromfile(opendialog1.filename);
- tgifimage(image1.picture.graphic).animationspeed:=100;
- tgifimage(image1.pictura.graphic).animate:=true;
- //(animationspeed=0 to 1000)
- //animationspeed设定动画速度。其实就是原始速度的百分比,例如50就是说是原始速度的50%;
- //如果设置animationspeed=0,则gif没有动画效果。
-
- Image1.Picture.LoadFromFile('1.gif');
- end;
-
- end.
复制代码 谢谢 |