Description
The gdk-pixbuf 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. These are essentially the overlay modes supported by GIF
animations.
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;
/* bounding box size */
int width, height;
}; |
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_ref ()
Adds a reference to an animation. Deprecated; use
g_object_ref(). The reference must be released afterwards using
g_object_unref().
gdk_pixbuf_animation_unref ()
Removes a reference from an animation. Deprecated; use g_object_unref().
gdk_pixbuf_animation_get_frames ()
Queries the list of frames of an animation.
gdk_pixbuf_animation_get_width ()
Queries the width of the bounding box of a pixbuf animation.
gdk_pixbuf_animation_get_num_frames ()
Queries the number of frames in a pixbuf animation.
gdk_pixbuf_animation_get_height ()
Queries the height of the bounding box of a pixbuf animation.
gdk_pixbuf_frame_get_pixbuf ()
Queries the pixbuf of an animation frame.
gdk_pixbuf_frame_get_action ()
Queries the overlay action of an animation frame.
gdk_pixbuf_frame_get_y_offset ()
Queries the Y offset of an animation frame.
gdk_pixbuf_frame_get_delay_time ()
Queries the delay time in milliseconds of an animation frame.
gdk_pixbuf_frame_get_x_offset ()
Queries the X offset of an animation frame.