Fwd: [cairo] how to use alpha blending by cairo?
Carl Worth
cworth at cworth.org
Thu Jul 13 08:46:52 PDT 2006
On Thu, 13 Jul 2006 13:53:07 +0530, Rajeev wrote:
> Now is there a work around for adding all channels(say, an alpha
> channel) of an image with cairo ??
You can, for example, use cairo_paint_with_alpha rather than
cairo_paint, for example, here perhaps:
> gdk_cairo_set_source_pixbuf (cr, pixbuf, 0, 0);
> cairo_paint(cr);
The cairo_paint_with_alpha function is a convenience function for the
much more general cairo_mask function which allows you to draw a
source through any mask you like. So paint with alpha simply creates a
mask with a uniform alpha value and then calls cairo_mask for
you. With calling cairo_mask directly you can do things such as using
a radial alpha gradient as the mask.
-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/20060713/be2f611c/attachment.pgp
More information about the cairo
mailing list