//定义一个显示图片的过程(这里是一个类的过程)参考:http://www.cnblogs.com/del88/archive/2012/02/03/2337566.html
procedure ImgShow(top_img_type: string; ImageXuhao: TImage);
var
pic_path: string;
begin
if top_img_type = 'loading' then
begin
pic_path := ExtractFilePath(ParamStr(0)) + 'img\gif\loading.gif';
ImageXuhao.Picture.LoadFromFile(pic_path);
// AnimationSpeed 设定动画速度,值越大,速度越快
TGIFImage(ImageXuhao.Picture.Graphic).AnimationSpeed := 300;
TGIFImage(ImageXuhao.Picture.Graphic).Animate := True;
ImageXuhao.Refresh;{这句必须加,否则会显示延迟}
end else if top_img_type = 'true' then begin
pic_path := ExtractFilePath(ParamStr(0)) + 'img\gif\true.gif';
ImageXuhao.Picture.LoadFromFile(pic_path);
ImageXuhao.Refresh;{这句必须加,否则会显示延迟}
end else begin
pic_path := ExtractFilePath(ParamStr(0)) + 'img\gif\false.gif';
ImageXuhao.Picture.LoadFromFile(pic_path);
ImageXuhao.Refresh;{这句必须加,否则会显示延迟}
end;
end;
调用:ImgShow('false',ImageXuhao1);
本文来自博客园,作者:del88,转载请注明原文链接:https://www.cnblogs.com/del88/archive/2012/02/11/2346456.html
浙公网安备 33010602011771号