[cairo] Exclusive OR (XOR) fillRect drawing

Prasanta Sadhukhan psadhukhan at gmail.com
Wed Aug 25 23:11:34 PDT 2010


Thanks Benjamin for your input
I actually would be working on cairo 1.8 so probably this will not help

Can anyone suggest if we can do something like this?

rgb = cairo_get_pixel(x,y) where x,y is the coordinate on screen
cairo_set_pixel(x,y, rgb ^ xorcolor)

or something similar

Thx in advance

On Wed, Aug 25, 2010 at 6:12 PM, Benjamin Otte <otte at redhat.com> wrote:

> You cannot do XOR with Cairo. What you can get (and I suspect that's
> what you want) is INVERT.
>
> To get the effect of INVERT, you'd do:
> cairo_set_operator (cr, CAIRO_OPERATOR_DIFFERENCE);
> cairo_set_source_rgb (cr, 1, 1, 1);
>
> Note that this requires Cairo 1.9 snapshots.
>
> Benjamin
>
>
> On Wed, 2010-08-25 at 17:02 +0530, Prasanta Sadhukhan wrote:
> > Hi
> >
> > I am a newbie to cairo. I saw in some of the discussion that cairo
> > does not support bitwise XOR drawing (like drawing same shape on same
> > area will make it disappear)
> > Can anyone please suggest as to how can I perform XOR drawing of
> > draw/fill shape ex fillrect with cairo APIs?
> >
> > I have some legacy programs that need to use XOR based drawing like
> > blinking of cursor under a line
> > Thx in advance
> >
> > --
> > cairo mailing list
> > cairo at cairographics.org
> > http://lists.cairographics.org/mailman/listinfo/cairo
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cairographics.org/archives/cairo/attachments/20100826/784b9904/attachment.html>


More information about the cairo mailing list