Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Animate Gifs in Perl\TK

by Macphisto (Hermit)
on Jul 11, 2000 at 21:34 UTC ( [id://22043]=perlquestion: print w/replies, xml ) Need Help??

Macphisto has asked for the wisdom of the Perl Monks concerning the following question:

Monks, I'm trying to get an animated .gif to display in a Perl\Tk script. It opens the .gif but it only displays the last cell of the animation. Is there any help/module that can be offered? Thank you Scott A Runnels

Replies are listed 'Best First'.
RE: Animate Gifs in Perl\TK
by autark (Friar) on Jul 11, 2000 at 22:10 UTC
    I believe you can use the Tk::Animation module. The manpage says:
    use Tk::Animation my $img = $widget->Animation('-format' => 'gif', -file => 'somefile.gi +f'); $img->start_animation($period); $img->stop_animation;
    It continues with:
    In the simple case when Animation is passed a GIF89 style
    GIF with multiple 'frames', it will build an internal array
    of Photo images.
    
    Autark
Re: Animate Gifs in Perl\TK
by Macphisto (Hermit) on Jul 14, 2000 at 21:01 UTC
    That doesn't seem to work. You could view the .gif I am trying to animate at:
    Gif

    The code I'm trying to use is....
    use Tk::Animation;
    my $mw = MainWindow->new;
    $mw->title("Animated Character");
    mw $img = $mw->Animation( -format => 'gif', -file => '/home/Scott/Chinese/Char/1(b).gif'); #1(b).gif is the animated .gif
    $period = 5;
    $img->start_animation($period);

    The beatings will continue until morale raises.
Re: Animate Gifs in Perl\TK
by ismyname (Initiate) on Aug 28, 2000 at 23:42 UTC
    Did You Get this to work? I need to Animate 13 frames from a animated gif but the code directly from the pod dosnt work I'm getting a Image1 error.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2024-04-24 08:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found