Trait gdk_pixbuf::prelude::PixbufAnimationExt

source ·
pub trait PixbufAnimationExt: IsA<PixbufAnimation> + Sealed + 'static {
    // Provided methods
    fn height(&self) -> i32 { ... }
    fn static_image(&self) -> Option<Pixbuf> { ... }
    fn width(&self) -> i32 { ... }
    fn is_static_image(&self) -> bool { ... }
Expand description

Trait containing all PixbufAnimation methods.


PixbufAnimation, PixbufNonAnim, PixbufSimpleAnim

Provided Methods§


fn height(&self) -> i32

Queries the height of the bounding box of a pixbuf animation.


Height of the bounding box of the animation.


fn static_image(&self) -> Option<Pixbuf>

Retrieves a static image for the animation.

If an animation is really just a plain image (has only one frame), this function returns that image.

If the animation is an animation, this function returns a reasonable image to use as a static unanimated image, which might be the first frame, or something more sophisticated depending on the file format.

If an animation hasn’t loaded any frames yet, this function will return NULL.


unanimated image representing the animation


fn width(&self) -> i32

Queries the width of the bounding box of a pixbuf animation.


Width of the bounding box of the animation.


fn is_static_image(&self) -> bool

Checks whether the animation is a static image.

If you load a file with gdk_pixbuf_animation_new_from_file() and it turns out to be a plain, unanimated image, then this function will return TRUE. Use gdk_pixbuf_animation_get_static_image() to retrieve the image.


TRUE if the “animation” was really just an image

Object Safety§

This trait is not object safe.