How to switch animated GIFs?

S

Scirious

People, I need a way to detect the moment an animated GIF gets to it's end
to switch to a different GIF. I can't use a Timer because the GIFs have
different times and doing so (as I'm doing at the moment) causes some of
the images to change before ti gets to the end and other run more than one
time.

Do animated GIFs trigger any event I can use to detect when it finished
executing?

If not, is there a way to do it?

TIA,
Scirious.
 
G

GhostInAK

Hello Scirious,

There's several methods depending on the circumstances..

Assumptions:
- The animation sequence is not known until runtime

Solution: Build an animation stream at runtime composed of the various gifs.
(Yes, the .NET framework can both play and edit animated gifs.)


Assumptions:
- The animation sequence is known at design time OR there is a very small
number of possible sequence permutations.

Solution: Build the composite gif/s at design time and include them as embedded
resources.


-Boo
 
S

Scirious

Thanks for the reply. The animation is not known until runtime because it
depends on user input. Actually, it is supposed to use a sequence of
animated GIFs to represent a sentence that is tyed by the user.

Please, how do I create an animation stream?

TIA,
Scirious.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top