Re: Create an animated gif
by poolpi (Hermit) on Nov 13, 2008 at 09:40 UTC
|
| [reply] [d/l] |
Re: Create an animated gif
by JavaFan (Canon) on Nov 13, 2008 at 01:14 UTC
|
| [reply] |
Re: Create an animated gif
by zentara (Cardinal) on Nov 13, 2008 at 11:31 UTC
|
| [reply] |
|
|
Ok here's the problem I. The project I'm doing this for doesn't have access to any of those libraries. It has the Tk library wich includes Tk::animation which sounds like it should be able to do what I want but I haven't found any examples. I also have access to the CGI library. Is there a way to create and save gif animations with that?
| [reply] |
|
|
Are you on Windows? Tk::Animation dosn't have a method to save it's animation. Most installs have ImageMagick, are you sure you don't? There are two ImageMagicks to check for, the PerlMagick module, and the c utilities. Does your system have a command called "convert"? If so, you have it. Otherwise, you will need to download the images to another computer, animate them, then upload them back. If you google for "make gif animations" there are some online sites that will do it, and return them to you.
| [reply] |
|
|
|
|
|
|
|
|
|
Re: Create an animated gif
by Anonymous Monk on Nov 13, 2008 at 09:22 UTC
|
| [reply] |
Re: Create an animated gif
by poolpi (Hermit) on Nov 14, 2008 at 11:17 UTC
|
#!/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
| [reply] [d/l] |
|
|
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.
| [reply] |
|
|
Yes I need the gif saved as a file. Does that save it as a file?
| [reply] |
|
|