[cairo] How to draw a Rect with red border
aolexiy at gmail.com
Mon Jan 23 11:12:34 PST 2006
On 1/23/06, yinglcs2 at yahoo.com <yinglcs2 at yahoo.com> wrote:
> How can I draw a Rect with red border?
> I know the function cairo_rectangle() to draw a Rect,
> but how can I set the color to "red"?
> cairo_rectangle(aSurf, 20, 20, 40, 40);
Set the colour with cairo_set_source_rgb(), like:
If you want to draw transparent rectangle, use cairo_set_source_rgba(),
cairo_set_source_rgb() assumes alpha component equal to 1.0.
After that use cairo_fill() to fill the rectangle and, optionally,
to draw rectangle's border.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cairo