문제

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 )

도움이 되었습니까?

해결책 2

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

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top