Thanks a lot, Kristian, you are right! gdk_pixbuf_new_from_file helps to keep the alpha channel from being ruined.<br>however my job not accomplished yet, now I can use gdk_pixbuf_composite do an overall alpha blending either by cairo_paint  or gdk_draw_pixbuf .&nbsp; But precisely what I need is to make alpha blending pixel by pixel, is there any api like gdk_pixbuf_composite without an overall_alpha parameter? Can cairo help to render an rgba pixbuf as my wish?
<br><br><br>Laowb<br><br><br><div><span class="gmail_quote">2006/6/30, Kristian Høgsberg &lt;<a href="mailto:krh@bitplanet.net">krh@bitplanet.net</a>&gt;:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On 6/27/06, lao wb &lt;<a href="mailto:laowenbo@gmail.com">laowenbo@gmail.com</a>&gt; wrote:<br>&gt; Hi<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;I am using GTK+ to do with my application. I have a bitmap without alpha<br>&gt; channel as my background, another bitmap with alpha channel to show above
<br>&gt; through to see the background. At first, I tried to use gdk to do this,<br>&gt; still not succeed yet, always&nbsp;&nbsp;show only the last one gdk_draw_pixbuf<br>&gt; invokes in the expose handler.<br><br>To do this with cairo, you can say something like:
<br><br>&nbsp;&nbsp;cr = gdk_cairo_create (widget-&gt;window);<br>&nbsp;&nbsp;gdk_cairo_set_source_pixbuf (cr, pixbuf, 0, 0);<br>&nbsp;&nbsp;cairo_paint (cr);<br>&nbsp;&nbsp;cairo_destroy (cr);<br><br>But I suspect the problem is you're loading an xpm file to a drawable
<br>and converting that to a pixbuf.&nbsp;&nbsp;Consider storing the overlay image<br>as a PNG file and load it using gdk_pixbuf_new_from_file().<br><br>cheers,<br>Kristian<br></blockquote></div><br>