On 1/23/06, <b class="gmail_sendername"><a href="mailto:yinglcs2@yahoo.com">yinglcs2@yahoo.com</a></b> <<a href="mailto:yinglcs2@yahoo.com">yinglcs2@yahoo.com</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
How can I draw a Rect with red border?<br><br>I know the function cairo_rectangle() to draw a Rect,<br>but how can I set the color to "red"?<br><br> cairo_rectangle(aSurf, 20, 20, 40, 40);<br></blockquote></div>
<br>
Set the colour with cairo_set_source_rgb(), like:<br>
cairo_set_source_rgb(cr, 1.0,0.0,0.0)<br>
If you want to draw transparent rectangle, use cairo_set_source_rgba(),<br>
cairo_set_source_rgb() assumes alpha component equal to 1.0.<br>
<br>
After that use cairo_fill() to fill the rectangle and, optionally, cairo_stroke()<br>
to draw rectangle's border.<br>
<br>
Olexiy<br>