开发者

Pixbuf overlapping / merge

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开发者_如何学Go argument, like the gdk_pixbuf_composite() C function ( http://developer.gnome.org/gdk-pixbuf/unstable//gdk-pixbuf-Scaling.html#gdk-pixbuf-composite )


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜