Question

Is there a way to overlap (but not overwrite) two gtk.gdk.Pixbuf in a gtk.IconView ?

For example, I've a cell with this pixbuf image : http://www.pirates-caraibes.com/media/zone/AnimMer.gif

I want to add this image : http://www.pirates-caraibes.com/media/objet/plage-coin-test12.gif to the cell, on the previous image (in order to display the previous image by transparency).

How i can to do this ?

Thanks

Edit : I've seen the gtk.gdk.Pixbuf.composite method but it doesn't have a src argument, like the gdk_pixbuf_composite() C function ( http://developer.gnome.org/gdk-pixbuf/unstable//gdk-pixbuf-Scaling.html#gdk-pixbuf-composite )

Était-ce utile?

La solution 2

As I mentionned above (in comment), I finally found the answer in the PyGTK FAQ.

Autres conseils

You can do it with the old GDK drawing API, but it disappeared in GTK 3. What works in both GTK 2 and 3 is to use the cairo API for that.

http://developer.gnome.org/gdk/stable/gdk-Cairo-Interaction.html

http://cairographics.org/samples/

What adds the transparency is called the "alpha" channel, which stands next to RGB channels. This means you need to make sure you're drawing to a ARGB cairo surface.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top