Description
The GdkPixbuf library provides a simple mechanism to load and
represent animations, primarily animated GIF files. Animations
are represented as lists of GdkPixbufFrame structures. Each
frame structure contains a GdkPixbuf structure and information
about the frame's overlay mode and duration.
Details
enum GdkPixbufFrameAction
typedef enum {
GDK_PIXBUF_FRAME_RETAIN,
GDK_PIXBUF_FRAME_DISPOSE,
GDK_PIXBUF_FRAME_REVERT
} GdkPixbufFrameAction; |
Each animation frame can have several things happen to it when the
next frame is displayed. The GdkPixbufFrameAction determines this.
If a frame as marked as GDK_PIXBUF_FRAME_RETAIN, then the image
will remain displayed, and will be potentially occluded by the next
frame. If it is marked as GDK_PIXBUF_FRAME_DISPOSE, then the
animation is reverted to the setting before the frame was shown. If
it is marked as GDK_PIXBUF_FRAME_REVERT, then the animation is
reverted to the first image before continuing.
struct GdkPixbufFrame
struct GdkPixbufFrame {
/* The pixbuf with this frame's image data */
GdkPixbuf *pixbuf;
/* Offsets for overlaying onto the animation's area */
int x_offset;
int y_offset;
/* Frame duration in ms */
int delay_time;
/* Overlay mode */
GdkPixbufFrameAction action;
}; |
This structure describes a frame in a GdkPixbufAnimation. Each
frame consists of a GdkPixbuf, an offset of the frame within the
animation's bounding box, a duration, and an overlay mode or
action.
struct GdkPixbufAnimation
struct GdkPixbufAnimation {
/* Reference count */
int ref_count;
/* Number of frames */
int n_frames;
/* List of GdkPixbufFrame structures */
GList *frames;
}; |
This structure describes an animation, which is represented as a
list of GdkPixbufFrame structures.
gdk_pixbuf_animation_new_from_file ()
Creates a new animation by loading it from a file. The file format is
detected automatically. If the file's format does not support multi-frame
images, then an animation with a single frame will be created.
gdk_pixbuf_animation_unref ()
Removes a reference from an animation. It will be destroyed when the
reference count drops to zero. At that point, all the frames in the
animation will be freed and their corresponding pixbufs will be unreferenced.