man Tk::Animation () - Display sequence of Tk::Photo images

NAME

Tk::Animation - Display sequence of Tk::Photo images

SYNOPSIS

  use Tk::Animation
  my $img = $widget->Animation('-format' => 'gif', -file => 'somefile.gif');

  $img->add_frame(@images);

  $img->start_animation( $period );

  $img->next_image;
  $img->prev_image;
  $img->set_image( 0 .. $#frames );

  $img->pause_animation;
  $img->resume_animation( $period );

  $img->fast_forward( $multiplier );
  $img->fast_reverse( $multiplier );

  $img->stop_animation;

  $img->blank( $boolean );

DESCRIPTION

In the simple case when CWAnimation is passed a GIF89 style GIF with multiple 'frames', it will build an internal array of CWPhoto images.

The CWadd_frame method adds images to the sequence. It is provided to allow animations to be constructed from separate images. All images must be CWPhotos and should all be the same size.

CWstart_animation($period) then initiates a CWrepeat with specified $period to sequence through these images. As for raw CWrepeat $period is in milliseconds, for a 50Hz monitor it should be at least 20mS. If CW$period is omitted it defaults to 100 milliseconds.

CWstop_animation cancels the CWrepeat and resets the image to the first image in the sequence.

For fine-grained control CWnext_image and CWprev_image move one frame forward or backward. CWset_image randomly positions the animation to a particular frame.

CWpause_animation pauses the movie and CWresume_animation continues from the pause point.

CWfast_forward and CWfast_reverse speed through the movie either forwards or backwards. CW$multiplier specifies how much faster the animation moves.

By default Animation leaves the previous movie frame in the animation photo. Many times overlaying subsequent frames produces a composite that looks blurred. The CWblank method is used to blank the animation photo before displaying new frames. The default is 0 for backward compatibility.

BUGS

The 'period' should probably be a property of the Animation object rather than specified at 'start' time. It may even be embedded in the GIF.