展开全部
要求说得不清楚,只能猜测你的目的了!嘿嘿
有几种方法:
1、用Timer控制
uses
Jpeg;
var
CurIndex:integer;
procedure TForm1.Timer1Timer(Sender:TObject);
begin
Image1.Picture.LoadFromFile('c:\images\pic'+IntToStr(CurIndex)+'.jpg');
Inc(CurIndex);
if CurIndex>100 then CurIndex := 0;
end;
procedure TForm1.FormCreate(Sender:TObject);
begin
CurIndex := 0; // 文件名pic0.jpg,pic1.jpg,pic2.jpg ...pic100.jpg
Timer1.Interval := 1000*5; // 5秒换一次
Timer1.Enabled := True;
end;
2、用循环控制
uses
Jpeg;
procedure TForm1.Button1Click(Sender:TObject);
var
i:integer;
begin
for i:=0 to 100 do begin
Image1.Picture.LoadFromFile('c:\images\pic'+IntToStr(i)+'.jpg');
Application.ProcessMessage;
Sleep(1000);
end;
end;
有几种方法:
1、用Timer控制
uses
Jpeg;
var
CurIndex:integer;
procedure TForm1.Timer1Timer(Sender:TObject);
begin
Image1.Picture.LoadFromFile('c:\images\pic'+IntToStr(CurIndex)+'.jpg');
Inc(CurIndex);
if CurIndex>100 then CurIndex := 0;
end;
procedure TForm1.FormCreate(Sender:TObject);
begin
CurIndex := 0; // 文件名pic0.jpg,pic1.jpg,pic2.jpg ...pic100.jpg
Timer1.Interval := 1000*5; // 5秒换一次
Timer1.Enabled := True;
end;
2、用循环控制
uses
Jpeg;
procedure TForm1.Button1Click(Sender:TObject);
var
i:integer;
begin
for i:=0 to 100 do begin
Image1.Picture.LoadFromFile('c:\images\pic'+IntToStr(i)+'.jpg');
Application.ProcessMessage;
Sleep(1000);
end;
end;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询