I'm a noob in Delphi V7. I'm creating a SlideShow, i need the images loaded in a ListView be sent to a Picture object using the OnTimer event of the Timer object. See the code I'm using:
procedure TForm1.Button1Click(Sender: TObject);
var i : integer;
begin
if open1.execute then
begin
for i := 0 to Open1.Files.Count - 1 do
// ShowMessage(Open1.Files[i]); // processa os arquivos aqui
with add.Items.Add do
begin
Caption:=ExtractFileName(Open1.Files[i]);
SubItems.Add( Open1.Files[i]);
SubItems.Add(ExtractfileExt(Open1.files[i]));
end;
The above section add various images of a opendialog object into a ListView.
procedure TForm1.Button2Click(Sender: TObject);
begin
timer1.enabled:=true;
//image1.Picture.loadfromfile(add.Items.Item[0].Caption);//Assign(add.Items.Item[0].Caption);
end;
This active the timer.
procedure TForm1.Timer1Timer(Sender: TObject);
var i: integer;
begin
for i := 0 to add.items.count -1 do
begin
image1.Picture.loadfromfile(add.Items.Item[i].Caption );//Assign(add.Items.Item[0].Caption);
end;
end;
But i'm need help in the last code. This not working.
I want the images to be loaded one by one in the image1 object whenever the timer times out, giving a slideshow effect, but the code that I typed in the OnTimer event, carries only one image.