[cairo] Erasing a surface (was: [cairo-announce] Cairo 0.5 porting guide)

Carl Worth cworth at cworth.org
Tue May 24 18:35:01 PDT 2005


On Tue, 17 May 2005 18:48:11 -0700, Carl Worth wrote:
> Erasing a surface to transparent
> --------------------------------
> Now:	cairo_set_source_rgba (cr, 0., 0., 0., 0.);
> 	cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
> 	cairo_paint (cr);

It's funny that I keep using the above code to demonstrate erasing to
transparent. That would be better labeled as setting a surface to a
uniform RGBA color, (with r, g, b, and a in place of the 0.0
values). Erasing to transparent is actually one step simpler:

	cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR);
	cairo_paint (cr);

-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/20050524/aa7ffbf1/attachment.pgp


More information about the cairo mailing list