<div>cairo_paint() should do.</div><div>&nbsp;</div><div>--MK</div><div>&nbsp;</div><div>27.08.2010, 17:11, "necko necko" &lt;opustenom@hotmail.com&gt;:</div><blockquote><br /><br />&gt; Date: Fri, 27 Aug 2010 14:46:03 +0200<br />&gt; Subject: Re: [cairo] Changing line color<br />&gt; From: <a href="mailto:mkbosmans@gmail.com">mkbosmans@gmail.com</a><br />&gt; To: <a href="mailto:opustenom@hotmail.com">opustenom@hotmail.com</a><br />&gt; CC: <a href="mailto:cairo@cairographics.org">cairo@cairographics.org</a><br />&gt; <br />&gt; 2010/8/27 necko necko &lt;<a href="mailto:opustenom@hotmail.com">opustenom@hotmail.com</a>&gt;:<br />&gt; &gt; In order for my pdf file to look nicer, I changed the background to black,<br />&gt; &gt; and now<br />&gt; &gt; I need to emphasize a number of lines between certain coordinates. Some<br />&gt; &gt; lines need<br />&gt; &gt; to be shown as red, some as green, and some as blue, or a variation.<br />&gt; &gt; I tested the above requirement with the code below:<br />&gt; &gt; &nbsp; cairo_set_line_width (cr, .5);<br />&gt; &gt; &nbsp; cairo_set_source_rgb(cr, 1, 0, 0);<br />&gt; &gt; &nbsp; cairo_move_to (cr, 152.84, -50.0);<br />&gt; &gt; &nbsp; cairo_line_to (cr, 83.97, 30.93);<br />&gt; &gt; &nbsp; cairo_stroke_preserve(cr);<br />&gt; &gt;<br />&gt; &gt; &nbsp; cairo_set_source_rgb(cr, 0, 0, 1);<br />&gt; &gt; &nbsp; cairo_move_to(cr, 90, 1);<br />&gt; &gt; &nbsp; cairo_line_to(cr, 40, 1);<br />&gt; &gt; &nbsp; cairo_stroke_preserve(cr);<br />&gt; &gt; ......................................<br />&gt; &gt; However, both lines are displayed as blue, with a very thin red line in the<br />&gt; &gt; middle of it.<br />&gt; &gt; Is there a way to specify that one line needs to be only blue, and the other<br />&gt; &gt; only red?<br />&gt; &gt; What would be the code to try?<br />&gt; &gt; I appreciate your help.<br />&gt; <br />&gt; You'll want to user cairo_stroke instead of cairo_stroke_preserve.<br />&gt; Because in the code above the second path from the blue line gets<br />&gt; added to the already exisiting path you used for the red line, thus<br />&gt; rendering the two lines on top of eachother.<br />&gt; <br />&gt; Maarten<br /><br />Thank you, Maarten.<br />In addition, is there some other way to change the background of the pdf file, instead of<br />specifying the bounding rectangle&nbsp; and then invoking fill()?<br /> <p>--<br />cairo mailing list<br /><a href="mailto:cairo@cairographics.org">cairo@cairographics.org</a><br /><a href="http://lists.cairographics.org/mailman/listinfo/cairo">http://lists.cairographics.org/mailman/listinfo/cairo</a></p></blockquote>