<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
<br><br>> Date: Fri, 27 Aug 2010 14:46:03 +0200<br>> Subject: Re: [cairo] Changing line color<br>> From: mkbosmans@gmail.com<br>> To: opustenom@hotmail.com<br>> CC: cairo@cairographics.org<br>> <br>> 2010/8/27 necko necko <opustenom@hotmail.com>:<br>> > In order for my pdf file to look nicer, I changed the background to black,<br>> > and now<br>> > I need to emphasize a number of lines between certain coordinates. Some<br>> > lines need<br>> > to be shown as red, some as green, and some as blue, or a variation.<br>> > I tested the above requirement with the code below:<br>> > cairo_set_line_width (cr, .5);<br>> > cairo_set_source_rgb(cr, 1, 0, 0);<br>> > cairo_move_to (cr, 152.84, -50.0);<br>> > cairo_line_to (cr, 83.97, 30.93);<br>> > cairo_stroke_preserve(cr);<br>> ><br>> > cairo_set_source_rgb(cr, 0, 0, 1);<br>> > cairo_move_to(cr, 90, 1);<br>> > cairo_line_to(cr, 40, 1);<br>> > cairo_stroke_preserve(cr);<br>> > ......................................<br>> > However, both lines are displayed as blue, with a very thin red line in the<br>> > middle of it.<br>> > Is there a way to specify that one line needs to be only blue, and the other<br>> > only red?<br>> > What would be the code to try?<br>> > I appreciate your help.<br>> <br>> You'll want to user cairo_stroke instead of cairo_stroke_preserve.<br>> Because in the code above the second path from the blue line gets<br>> added to the already exisiting path you used for the red line, thus<br>> rendering the two lines on top of eachother.<br>> <br>> 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 and then invoking fill()?<br>                                            </body>
</html>