Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Animation

Posted on 1999-07-21
6
Medium Priority
?
228 Views
Last Modified: 2013-11-19
Is there a way to animate more than one image with the Timer control?
Example,
 There are 5 images to be animated.
 Every second, one of these 5 images will be put into a Main Image, called imgMain.
 So that all animation goes to imgMain
0
Comment
Question by:jackjoker
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 17

Expert Comment

by:inthe
ID: 1390342
hi,
this might work let me know:
have the timer set to 100 and
do this on timer event:

timer1.enabled:=false;
imgmain.picture.graphic:=the_graphic1.
sleep 100;
imgmain.picture.graphic:=the_graphic2.
sleep 100;
imgmain.picture.graphic:=the_graphic3.
sleep 100;
imgmain.picture.graphic:=the_graphic4.
sleep 100;
imgmain.picture.graphic:=the_graphic5.
timer1 enabled:=true;

Regards Barry

0
 
LVL 17

Expert Comment

by:inthe
ID: 1390343
1000 not 100 ;-)
0
 
LVL 1

Expert Comment

by:rpetruni
ID: 1390344
Hi jackjoker,

do you meen 5 set of animation like:
for i:=1 to 5 do
begin
if i=1 then Animation1 // with 5 pics
else if i=2 then Animation2 etc.?// 5 pics
end;

or you yust have 5 pics you wish to be one animaition?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 10

Accepted Solution

by:
viktornet earned 40 total points
ID: 1390345
try this...

var
  Form1: TForm1;

  counter : integer = 0;

implementation

{$R *.DFM}

procedure TForm1.Timer1Timer(Sender: TObject);
begin
     Image1.Canvas.FillRect(Image1.Canvas.ClipRect);
     ImageList1.GetBitmap(counter mod (ImageList1.Count-1), Image1.Picture.Bitmap);
     inc(counter);
end;

..-=ViKtOr=-..
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1390346
btw, I forgot to mention... put an ImageList component on your form, and then load some imags in there... then use the above code with the timer's interval set to 1 (even though it's 50 in reality) and everything should work just fine..

..-=ViKtOr=-..
0
 
LVL 17

Expert Comment

by:inthe
ID: 1390347
that works good ;-)
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

664 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question