<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
<br><br><hr id="stopSpelling">From: mikhailkozhevnikov@yandex.ru<br>To: opustenom@hotmail.com<br>CC: mkbosmans@gmail.com; cairo@cairographics.org<br>Subject: Re: [cairo] Changing line color<br>Date: Fri, 27 Aug 2010 18:07:29 +0400<br><br><div>cairo_paint() should do.</div><div> </div><div>--MK</div><div> </div><div>27.08.2010, 17:11, "necko necko" <opustenom@hotmail.com>:</div><blockquote><br><br>> Date: Fri, 27 Aug 2010 14:46:03 +0200<br>> Subject: Re: [cairo] Changing line color<br>> From: <a href="mailto:mkbosmans@gmail.com">mkbosmans@gmail.com</a><br>> To: <a href="mailto:opustenom@hotmail.com">opustenom@hotmail.com</a><br>> CC: <a href="mailto:cairo@cairographics.org">cairo@cairographics.org</a><br>> <br>> 2010/8/27 necko necko <<a href="mailto:opustenom@hotmail.com">opustenom@hotmail.com</a>>:<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> --<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" target="_blank">http://lists.cairographics.org/mailman/listinfo/cairo</a><BR><br><BR><a href="http://lists.cairographics.org/mailman/listinfo/cairo" target="_blank">Thanks!<br></a><BR></blockquote>                                            </body>
</html>