[cairo] Stroke to path

Mindaugas Kavaliauskas dbtopas at dbtopas.lt
Thu Oct 7 15:18:52 PDT 2010


Hi,


how can I obtain a egde of current stroke as a path. It's something that 
can be done using Inkscape Menu->Path->"Stroke to path".

It's very useful, f.e., if I need to draw a road (on a map) using a 
brown line with a black edge. I would expect something like:
   ...
   cairo_set_source_rgb(ctx, 0.5, 0.25, 0);
   cairo_set_line_width(ctx, 1);
   cairo_stroke_preserve(ctx);
   cairo_stroke_to_path(ctx);
   cairo_set_source_rgb(ctx, 0, 0, 0);
   cairo_set_line_width(ctx, 0.2);
   cairo_stroke(ctx);

If no function like cairo_stroke_to_path() exist, how can I calculate 
edge of the path? Well, it would be nice to respect cairo_set_dash() 
setting also :)


Thanks,
Mindaugas


More information about the cairo mailing list