hi, i have incorporated the changes suggested by you. i got a error "invalid value for an input cairo_format_t". i have checked the permission, it is read write.<br><br><div class="gmail_quote">On Thu, Apr 17, 2008 at 6:39 PM, Chris Wilson <<a href="mailto:chris@chris-wilson.co.uk">chris@chris-wilson.co.uk</a>> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d">On Thu, 2008-04-17 at 18:24 +0530, Chandra Shekhar Sengupta wrote:<br>
> Hi ,<br>
> i have tried with adding "get_target" in all possible places, but<br>
> still "write_png" is saving zero byte png.i have attched the full<br>
> code . Could you tell how to save that surface?<br>
<br>
</div>Compiled and ran your example - it generated 'sticker.png' flawlessly.<br>
<div class="Ih2E3d"><br>
> if(cairo_surface_status(tsurf) != CAIRO_STATUS_SUCCESS)<br>
> g_print(" nil surface \n");<br>
> else<br>
> cairo_surface_write_to_png (tsurf, "sticker.png");<br>
<br>
</div>I'd suggest replacing this section to check the status return from<br>
cairo_surface_write_to_png(), i.e.<br>
status = cairo_surface_write_to_png (tsurf, "sticker.png");<br>
if (status) {<br>
g_print ("Failed to write \"%s\": %s\n",<br>
"sticker.png",<br>
cairo_status_to_string (status));<br>
}<br>
<br>
However, I would first check the permissions on 'sticker.png'.<br>
<br>
--<br>
<font color="#888888">Chris Wilson<br>
<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Regards,<br>Chandra Shekhar Sengupta<br><br>