1

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 )

Loïc G.
  • 3,087
  • 3
  • 24
  • 36
  • I finally found the answer here : http://faq.pygtk.org/index.py?req=show&file=faq08.018.htp – Loïc G. Sep 25 '11 at 11:41
  • How about taking a look at the PyGtk FAQ Entry: [How blend (composite) two images together?](http://faq.pygtk.org/index.py?req=show&file=faq08.018.htp) – Dan D. Sep 25 '11 at 11:43

2 Answers2

0

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.

liberforce
  • 11,189
  • 37
  • 48
0

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

Loïc G.
  • 3,087
  • 3
  • 24
  • 36