menxin 的程序确实没有问题, 但改为
const
files: array[0..20] of String = (
'c:/windows/acdwal~1.bmp',
'c:/windows/clouds.bmp',
...);
begin
for i:=0 to 200 do begin
Image1.Picture.LoadFromFile(files);
Caption:=IntToStr(i); end;
end;
就有问题了, 原因未明, 我用的方法是:
const
files: array[0..20] of String = (
'c:/windows/acdwal~1.bmp',
'c:/windows/clouds.bmp',
...);
var
bmp: TBitmap;
begin
for i:=0 to 200 do
begin
bmp := TBitmap.Create;
try
bmp.LoadFromFile(files);
Image1.Picture.Bitmap.Assign(bmp);
Caption:=IntToStr(i);
finally
bmp.free;
end;
end;
end;
虽然慢了点, 但管用.