Board index » delphi » Delay procedure for animation

Delay procedure for animation

Hi, I'm writing a little demo program that shows some animations by
changing the bitmap of a tImage, waiting for the timer, changing bitmap
again, etc.

Although it does work, I don't know if a timer is the answer here, does
someone have a delay procedure I could use? I got one from a book on
Delphi that uses Application.ProcessMessages to pause the program, but
it delays the whole program - you can't even terminate the program when
it is still in a delay..

Well, I don't know if I described my problem accurately enough, but any
help would be appreciated. I check newsgroups about twice a week, but if
you want to email me just remove the NOSPAM.

Thanks in advance
- Dylan

 

Re:Delay procedure for animation


Stick with the timer.

Re:Delay procedure for animation


Use:

var
  T: Cardinal;
begin
  T := GetTickCount + 100;
  while (T > GetTickCount) and not Application.Terminated do
    Application.ProcessMessages;
end;

"RevenanT" <dy...@NOSPAM.intekom.co.za> schreef in bericht
news:398CF4E5.1012D15@NOSPAM.intekom.co.za...

Quote
> Hi, I'm writing a little demo program that shows some animations by
> changing the bitmap of a tImage, waiting for the timer, changing bitmap
> again, etc.

> Although it does work, I don't know if a timer is the answer here, does
> someone have a delay procedure I could use? I got one from a book on
> Delphi that uses Application.ProcessMessages to pause the program, but
> it delays the whole program - you can't even terminate the program when
> it is still in a delay..

> Well, I don't know if I described my problem accurately enough, but any
> help would be appreciated. I check newsgroups about twice a week, but if
> you want to email me just remove the NOSPAM.

> Thanks in advance
> - Dylan

Other Threads