[cairo] How to draw a inverted area?
Carlos Garcia Campos
carlosgc at gnome.org
Mon Jun 7 08:14:06 PDT 2010
Excerpts from Magicloud Magiclouds's message of lun jun 07 13:44:21 +0200 2010:
> I cannot find that operator. I think you meant cairo_operator_t?
Yes, you need cairo >= 1.9.2
> typedef enum _cairo_operator {
> CAIRO_OPERATOR_CLEAR,
>
> CAIRO_OPERATOR_SOURCE,
> CAIRO_OPERATOR_OVER,
> CAIRO_OPERATOR_IN,
> CAIRO_OPERATOR_OUT,
> CAIRO_OPERATOR_ATOP,
>
> CAIRO_OPERATOR_DEST,
> CAIRO_OPERATOR_DEST_OVER,
> CAIRO_OPERATOR_DEST_IN,
> CAIRO_OPERATOR_DEST_OUT,
> CAIRO_OPERATOR_DEST_ATOP,
>
> CAIRO_OPERATOR_XOR,
> CAIRO_OPERATOR_ADD,
> CAIRO_OPERATOR_SATURATE
> } cairo_operator_t;
>
> On Mon, Jun 7, 2010 at 6:03 PM, Carlos Garcia Campos <carlosgc at gnome.org> wrote:
> > Excerpts from Magicloud Magiclouds's message of lun jun 07 09:44:10 +0200 2010:
> >> Hi, sorry the subject is not clear.
> >> I mean that, first I draw something in the cairo context, then I draw
> >> a circle in it, which acts like a invert mask. All colors in its area
> >> are inverted.
> >
> > I think filling with white with the difference operator is what you
> > want
> >
> > cairo_set_source_rgb (cr, 1., 1., 1.);
> > cairo_set_operator (cr, CAIRO_OPERATOR_DIFFERENCE);
> > cairo_fill(cr);
> >
> >> I thought xor operator helped, but it did not....
> >> Thanks.
> >
> > Regards,
> >
>
--
Carlos Garcia Campos
PGP key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x523E6462
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.cairographics.org/archives/cairo/attachments/20100607/d87ac06e/attachment.pgp>
More information about the cairo
mailing list