[cairo] Help: Question on Cairo::OPERATOR_XOR of set_operator?

Will lisb at cs.man.ac.uk
Wed Oct 8 06:06:39 PDT 2008


Hi,
        
        I am a new user of cairo and I am wondering how to use the XOR
        mode. 
        
        In computer graphics, the screen can restore original color if
        we draw
        the same operation 2 times in XOR mode. I understand that cairo
        supports
        the function. Intuitively, I wrote the following codes for
        testing XOR
        mode use:
        
                cr->set_line_width(1.0);
                cr->set_source_rgb(0.0, 0.8, 0.0);
                cr->move_to(0,0);
                cr->line_to(50,50);
        
                cr->set_operator(Cairo::OPERATOR_XOR);
                cr->stroke_preserve();
                cr->stroke();
        
        However, the original color is not restored. I tried several
        other ways
        but there is no way out.
        
        Can any one give me some hints?
        
        
        Thanks.
        
        
        
        



More information about the cairo mailing list