[cairo] Is Cairo able to fit my needs?

Innova-Studios - Juergen Ladstaetter info at innova-studios.com
Fri Oct 5 10:52:08 PDT 2007


Thanks Dirk, that was absolutely what i was searching for!

Thanks mate


-----Ursprüngliche Nachricht-----
Von: Dirk Schönberger [mailto:dirk.schoenberger at sz-online.de] 
Gesendet: Donnerstag, 04. Oktober 2007 19:55
An: Innova-Studios - Juergen Ladstaetter
Cc: cairo at cairographics.org
Betreff: Re: [cairo] Is Cairo able to fit my needs?

> I tried your suggestion with CAIRO_FILL_RULE_EVEN_ODD and
> CAIRO_FILL_RULE_WINDING. Two black squares overlapping each other, each in
a
> single path:

The fill rule works when the path is rendered, not on the surfaces.
You should try to paint both sub-paths in one action, i.e.

cairo_new_sub_path( cr);
cairo_line_to( cr, 0, 0 );
cairo_line_to( cr, 0, 1000 );
cairo_line_to( cr, 1000, 1000 );
cairo_line_to( cr, 1000, 0 );
cairo_line_to( cr, 0, 0 );
cairo_close_path( cr );

cairo_new_sub_path( cr);
cairo_line_to( cr, 200, 200 );
cairo_line_to( cr, 200, 400 );
cairo_line_to( cr, 400, 400 );
cairo_line_to( cr, 400, 200 );
cairo_line_to( cr, 200, 200 );
cairo_close_path( cr );

cairo_set_source_rgba( cr, 0, 0, 0, 1);
cairo_set_fill_rule(cr, CAIRO_FILL_RULE_EVEN_ODD);
cairo_fill (cr);

Regards
DIrk




More information about the cairo mailing list