Re: GdkPixbufAnimation

On Fri, Apr 27, 2001 at 01:57:24AM -0400, Havoc Pennington wrote:
> Helmethead <hoshem mel comcen com au> writes:
> > While on the subject, you should try using the GdkPixbufLoader. I haven't been able to get my head very well around the problems and come up with a solution..
> > 
> > I vaguely remember some things:
> > - Biggest problem is that area_prepared doesn't pass in the new
> > pixbuf as documented, making the api unusable
> You just call gdk_pixbuf_loader_get_pixbuf() when you get this signal.

This gets the first frame pixbuf, not the latest one I think. I wrote an incremental loader and had to use this line to get pixbufs on 2nd or later frames:
        gtk_image_set_from_pixbuf (GTK_IMAGE (cb_context->image), * (GdkPixbuf **) loader->priv);
alot prettier than it could have been mind you ;)

> > - The api is awkward and crappy to implement. It seems designed for
> > applications that don't know whether they want a pixbuf or an
> > animation, which is a bit silly.
> > - It requires that the first frame of an animation be used as the
> > "static image" if that's what the app wants. Maybe this is what you
> > want though, I don't know. 
> I believe you can just ignore the animation part using only the area_*
> signals. See gtk-demo, if I've checked in my image demo, I think I
> have.

But if you're after an animation, you have to include code in case that frame_done signal never comes through to deal with a pixbuf.

I'll try and explain better what I meant in my third point.
I rewrote the gif decoder as a little exercise, and at first, if the app asked for a pixbuf, I tried to return the first frame painted on top of the GIF "logical screen area", which is set to the background colour. There were problems with doing this, so I had to just return the same pixbuf I would return in the first GdkPixbufFrame. Basically, if the first frame in a GIF file does not fill the entire logical screen area, the current model of loader can't render it according to spec.

> > The loader api also depends on the GtkPixbufFrame style of doing
> > things, if you want to abolish it you need to rework the loader I
> > think.
> This is true.
> I'm not sure what the semantics of the loader are exactly with
> animations, need to think it through.
> Havoc

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]