GdkDrawable / GdkPixbuf / Transparence



Hello:

 Due to the characteristics of the Gambas GTK+ component I'm writting,
(http://gambas.sf.net for those interested), I have to perform
conversions between GdkDrawable and GdkPixbuf (well, I really have
to render a pixbuf in a drawable and extract a pixbuf from drawable)
The drawable i use is a GdkPixmap.

 I have problems with transparences, in this part of the code, I've
loaded a PNG icon in a pixbuf (called img) and I try to render it in
a pixmap (pic->image)

...
scr=gdk_screen_get_default();
depth=(gdk_screen_get_system_visual(scr))->depth;
pic->image=gdk_pixmap_new (NULL,myw,myh,depth);
gdk_drawable_set_colormap(GDK_DRAWABLE(pic->image),gdk_colormap_get_system());
gdk_draw_pixbuf(pic->image,NULL,img,0,0,0,0,-1,-1,GDK_RGB_DITHER_MAX,0,0); ...

After rendering, transparecy (or alpha) is lost. Gtk+ reference docs
says something about GdkGC and 'clips', but I can not understand it,
even looking at the GTK+ examples...

May be any example to perform this?

Regards,



-- 
Daniel Campos <danielcampos netcourrier com>




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