[Gtk-sharp-list] Getting frames from a GIF animation

Doug Blank doug.blank at gmail.com
Wed Apr 10 17:41:10 UTC 2013

Gtk-sharp List,

I can use the Gtk# interface to get the frames of a gif animation
based on time, like the following IronPython code shows:

image = Gtk.Image(filename)
if image.Animation:
    if not image.Animation.IsStaticImage:
        iter = image.Animation.GetIter(System.IntPtr.Zero)
        while iter.DelayTime > -1:
            pixbuf = iter.Pixbuf
            ## do something with pixbuf
            iter.Advance(System.IntPtr.Zero) ## advance to current time

But, can I actually get the actual individual *frames* from the gif
file? That is, I can use this interface to step through time getting
the appropriate image for the specified time, but if an animated gif
has 7 gifs in it, is there a direct way to just get the 7 pixbufs?

Thanks for any pointers,


More information about the Gtk-sharp-list mailing list