[cairo] Regarding saving a image surface as PNG
Chandra Shekhar Sengupta
sayan801 at gmail.com
Fri Apr 18 00:48:48 PDT 2008
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.
On Thu, Apr 17, 2008 at 6:39 PM, Chris Wilson <chris at chris-wilson.co.uk>
wrote:
> On Thu, 2008-04-17 at 18:24 +0530, Chandra Shekhar Sengupta wrote:
> > Hi ,
> > i have tried with adding "get_target" in all possible places, but
> > still "write_png" is saving zero byte png.i have attched the full
> > code . Could you tell how to save that surface?
>
> Compiled and ran your example - it generated 'sticker.png' flawlessly.
>
> > if(cairo_surface_status(tsurf) != CAIRO_STATUS_SUCCESS)
> > g_print(" nil surface \n");
> > else
> > cairo_surface_write_to_png (tsurf, "sticker.png");
>
> I'd suggest replacing this section to check the status return from
> cairo_surface_write_to_png(), i.e.
> status = cairo_surface_write_to_png (tsurf, "sticker.png");
> if (status) {
> g_print ("Failed to write \"%s\": %s\n",
> "sticker.png",
> cairo_status_to_string (status));
> }
>
> However, I would first check the permissions on 'sticker.png'.
>
> --
> Chris Wilson
>
>
--
Regards,
Chandra Shekhar Sengupta
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cairographics.org/archives/cairo/attachments/20080418/9e2b6c65/attachment.html
More information about the cairo
mailing list