[cairo] applying alpha to a pattern

Benjamin Otte otte at redhat.com
Fri Apr 16 06:02:54 PDT 2010


Currently you would use something like:

cairo_push_group (cr);
/* draw pattern */
cairo_pop_group_to_source (cr);
cairo_paint_with_alpha (cr, alpha);

There has been talk about adding a global alpha parameter to cairo_t,
but it's not been implemented yet.


On Fri, 2010-04-16 at 14:47 +0200, Theo Veenker wrote:
> Hi,
> Given a path that I need to stroke/fill with an arbitary pattern (solid color,
> gradient or suface based), is it possible to stroke/fill it with alpha applied
> to the pattern?  I guess I'm basically looking for cairo_{stroke|fill}_with_alpha()
> or a procedure to achieve this efficiently.
> Would it make sense to add something like cairo_{stroke|fill}_with_alpha() or
> perhaps to add an alpha attribute to cairo_pattern_t? It would make fading
> in/out graphics a lot easier I think.
> Theo
> --
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo

More information about the cairo mailing list