Page 1 of 1

TPicShow question

PostPosted: July 10th, 2008, 10:18 pm
by galcott
I am using TPicShow in Delphi 5. I am not loading the images from files but have 12 TImage controls on the form containing the images. The timer on the form has its interval set to 1000 but I have noticed that the transitions are not always occurring at a regular interval. As I cycle through the 12 images, usually 2 or 3 of them will display for only a fraction of a second instead of a full second. This is the code on the form and I would like to know what might cause the problem. Thank you.

Glenn

----------

Code: Select all
procedure TfrmDemo.FormShow(Sender: TObject);
begin
  n:=0;
  ShowNextImage;
end;

procedure TfrmDemo.ShowNextImage;
begin
  inc(n);
  if n=13 then n:=1;
  PicShow1.Picture.Assign(nil);
  case n of
    1: PicShow1.Picture.Assign(TopImage1.Picture);
    2: PicShow1.Picture.Assign(TopImage2.Picture);
    3: PicShow1.Picture.Assign(TopImage3.Picture);
    4: PicShow1.Picture.Assign(TopImage4.Picture);
    5: PicShow1.Picture.Assign(TopImage5.Picture);
    6: PicShow1.Picture.Assign(TopImage6.Picture);
    7: PicShow1.Picture.Assign(TopImage7.Picture);
    8: PicShow1.Picture.Assign(TopImage8.Picture);
    9: PicShow1.Picture.Assign(TopImage9.Picture);
    10: PicShow1.Picture.Assign(TopImage10.Picture);
    11: PicShow1.Picture.Assign(TopImage11.Picture);
    12: PicShow1.Picture.Assign(TopImage12.Picture);
  end;
  PicShow1.Execute;
end;

procedure TfrmDemo.Timer1Timer(Sender: TObject);
begin
  if not PicShow1.Busy then
    ShowNextImage;
end;

PostPosted: July 11th, 2008, 7:34 am
by Kambiz
Set ExactTiming property to True. Or, instead of a timer, use OnComplete event to load next image.