[cairo] changing alpha in herds

Carl Worth cworth at cworth.org
Mon Nov 5 13:15:25 PST 2007


On Mon, 5 Nov 2007 22:50:36 +0200, Donn wrote:
> Hi again,
> In my random quest to draw things from a stack, I am wondering how best to
> tackle this:

Hi again, Donn,

I'm quite glad that so far your questions have fairly easy
answers. :-)

> I'm aiming for:
> <some voodoo alpha = 0.5>
> BigSquare.draw()
> <end voodoo>
>
> If that makes any sense :)

Yes, I think it does. Here's some voodoo that might be exactly what
you're looking for, (I'll write in C because I'm much less likely to
make it totally wrong than if I attempted python---hopefully you'll be
able to translate to python just fine---if you have any trouble just
ask).

	cairo_push_group (cr);
	draw (BigSquare);
	cairo_pop_group_to_source (cr);
	cairo_paint_with_alpha (cr, 0.5);

I hope that helps! If you need voodoo with different semantics, let us
know.

And please feel free to add anything useful you learn to the cairo
website. The whole thing is a world-writable wiki, (small registration
step required first). For example, you might add things here:

	http://cairographics.org/cookbook/

Have fun with cairo!

-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.cairographics.org/archives/cairo/attachments/20071105/f9cb4697/attachment-0001.pgp 


More information about the cairo mailing list