1Prima::Image::AnimateGIUFs(e3r)Contributed Perl DocumentPartiimoan::Image::AnimateGIF(3)
2
3
4
6 Prima::Image::AnimateGIF - animate gif files
7
9 The module provides high-level access to GIF animation sequences.
10
12 use Prima qw(Application Image::AnimateGIF);
13 my $x = Prima::Image::AnimateGIF->load($ARGV[0]);
14 die $@ unless $x;
15 my ( $X, $Y) = ( 0, 100);
16 my $background = $::application-> get_image( $X, $Y, $x-> size);
17 $::application-> begin_paint;
18
19 while ( my $info = $x-> next) {
20 my $frame = $background-> dup;
21 $frame-> begin_paint;
22 $x-> draw( $frame, 0, 0);
23 $::application-> put_image( $X, $Y, $frame);
24
25 $::application-> sync;
26 select(undef, undef, undef, $info-> {delay});
27 }
28
29 $::application-> put_image( $X, $Y, $g);
30
31 new $CLASS, %OPTIONS
32 Creates an empty animation container. If $OPTIONS{images} is given, it
33 is expected to be an array of images, best if loaded from gif files
34 with "loadExtras" and "iconUnmask" parameters set ( see
35 Prima::image-load for details).
36
37 load $SOURCE, %OPTIONS
38 Loads GIF animation sequence from file or stream $SOURCE. Options are
39 the same as understood by "Prima::Image::load", and are passed down to
40 it.
41
42 add $IMAGE
43 Appends an image frame to the container.
44
45 bgColor
46 Return the background color specified by the GIF sequence as the
47 preferred background color to use when there is no specific background
48 to superimpose the animation to.
49
50 current
51 Return index of the current frame
52
53 draw $CANVAS, $X, $Y
54 Draws the current composite frame on $CANVAS at the given coordinates.
55
56 height
57 Returns height of the composite frame.
58
59 icon
60 Creates and returns an icon object off the current composite frame.
61
62 image
63 Creates and returns an image object off the current composite frame.
64 The transparent pixels on the image are replaced with the preferred
65 background color.
66
67 is_stopped
68 Returns true if the animation sequence was stopped, false otherwise.
69 If the sequence was stopped, the only way to restart it is to call
70 "reset".
71
72 length
73 Returns total animation length (without repeats) in seconds.
74
75 loopCount [ INTEGER ]
76 Sets and returns number of loops left, undef for indefinite.
77
78 masks
79 Return the AND and XOR masks, that can be used to display the current
80 composite frame.
81
82 next
83 Advances one animation frame. The step triggers changes to the
84 internally kept AND and XOR masks that create effect of transparency,
85 if needed. The method return a hash, where the following field are
86 initialized:
87
88 left, bottom, right, top
89 Coordinates of the changed area since the last frame was updated.
90
91 delay
92 Time ins seconds how long the frame is expected to be displayed.
93
94 reset
95 Resets the animation sequence. This call is necessary either when image
96 sequence was altered, or when sequence display restart is needed.
97
98 size
99 Returns width and height of the composite frame.
100
101 total
102 Return number fo frames
103
104 width
105 Returns width of the composite frame.
106
108 Prima::image-load, <http://www.the-labs.com/GIFMerge/>
109
111 Dmitry Karasik, <dmitry@karasik.eu.org>.
112
113
114
115perl v5.28.1 2019-02-02 Prima::Image::AnimateGIF(3)