Issue on Cairo to create png image

Issue on Cairo to create png image

BY 06 Mar 2015 Native Application Development

Hi,

I am try to create a png image by using cairo, according the guide on help doc. 

Graphics Cairo Tutorial

    cairo_surface_t *surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 240, 80);
	cairo_t *cairo = cairo_create (surface);
	cairo_rectangle(cairo, 10, 10, 220, 60);
	cairo_stroke(cairo);
	cairo_surface_write_to_png (surface, "cairo.png");
	cairo_surface_flush(surface);
	cairo_destroy (cairo);
	cairo_surface_destroy (surface);

Run the app on emulator, there isn’t bug/error raised while app running. But actually I can’t find the “cairo.png” image file on the emulator, by execute cammand on shell find / -name cairo.png

What’s wrong in my sample code?

Written by