[cairo] how to use alpha blending by cairo?

Carl Worth cworth at cworth.org
Mon Jul 10 11:58:51 PDT 2006


On Fri, 30 Jun 2006 18:06:12 +0800, "lao wb" wrote:
> Thanks a lot, Kristian, you are right! gdk_pixbuf_new_from_file helps to
> keep the alpha channel from being ruined.
> 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 .  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?

The cairo_paint() function (as well as any other cairo drawing
function) will always respect any alpha values you have in your source
pattern. If you are using cairo_paint() and have not changed the
default cairo operator from CAIRO_OPERATOR_OVER, then I would suspect
that the problem lies in the alpha values of your source surface.

-Carl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20060710/d516db24/attachment.pgp


More information about the cairo mailing list