cairo graphics 0.5 (arc )



/* Jeffrin Jose Licensed GPL v3 Copyright
August 2010 GPL --> http://www.gnu.org/copyleft/gpl.html */

#include

int
main ()
{
int i;
cairo_surface_t *surface =
cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 800, 600);
cairo_t *cr =
cairo_create (surface);

cairo_set_font_size (cr, 32.0);
cairo_set_source_rgb (cr, 0.3, 0.8, 0.7);
cairo_set_line_width(cr,1.0);

for (i=0;i<100;i++)
{
/* cairo_move_to(cr,30+i,60);
cairo_line_to(cr,30+i,60+i);*/
/* cairo_rectangle(cr,100,100,10+i,10+i);*/
cairo_arc(cr,100,100,60,50,10);
/* cairo_line_to(cr,40,200); */

cairo_stroke(cr);
/* cairo_surface_flush(surface); */
/* usleep(100000);*/
}

/* cairo_rectangle(cr,30,20,67,70);*/
/* cairo_stroke(cr);*/

cairo_destroy (cr);
cairo_surface_write_to_png (surface, "imagecairo-arc.png");
cairo_surface_destroy (surface);
return 0;
}

Output

http://jeffrin.files.wordpress.com/2010/08/cairoarc1.pngwp-content/uploads/2010/08/imagecairo-arc.png

 

Leave a Reply

Your email address will not be published. Required fields are marked *