Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Create an animated gif

by poolpi (Hermit)
on Nov 14, 2008 at 11:17 UTC ( [id://723625]=note: print w/replies, xml ) Need Help??


in reply to Create an animated gif

Working solution with Tk::Animation :
It's create an animated gif with some flat gif files

#!/usr/bin/perl use strict; use warnings; use Tk; use Tk::Animation; my $mw = MainWindow->new; $mw->title("Animated GIF"); my @gif_files = qw/mygif.gif mygif1.gif/; my $animate = $mw->Animation; for (@gif_files) { $animate->add_frame( $mw->Photo( -file => $_ ) ); } $animate->set_image(0); my $lab = $mw->Label( -image => $animate )->grid; my $start = $mw->Button( -text => 'Start', -command => [ $animate => 'start_animation', 500 ] )->grid; my $stop = $mw->Button( -text => 'Stop', -command => [ $animate => 'stop_animation' ] )->grid; MainLoop;

Update : link to the gif files

hth,
PooLpi

'Ebry haffa hoe hab im tik a bush'. Jamaican proverb

Replies are listed 'Best First'.
Re^2: Create an animated gif
by zentara (Archbishop) on Nov 14, 2008 at 14:46 UTC
    Yes, but that script does NOT save the animated gif as a file. I think the OP needed to save the animation to be sent out in a non-Tk application, like in a mail or html file.

    I'm not really a human, but I play one on earth Remember How Lucky You Are
      Yes I need the gif saved as a file. Does that save it as a file?

        Under UNIX/Linux, you can just load ONE image from a window with Tk::WinPhoto.
        As zentara pointed it out just above, under Windows with Tk, it seems to be unfeasible ):
        See this zentara's node for information

        hth,
        PooLpi

        'Ebry haffa hoe hab im tik a bush'. Jamaican proverb

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://723625]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-03-29 07:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found