[cairo] rotating GdkPixbuf with cairo
domlachowicz at gmail.com
Tue Apr 1 10:03:23 PDT 2008
You need to save your "srf" to a file. gdk_cairo_set_source_pixbuf()
makes a copy of the pixbuf's pixels. You can use
cairo_surface_write_to_png() to accomplish what you want to do.
On Tue, Apr 1, 2008 at 12:49 PM, LRN <lrn1986 at gmail.com> wrote:
> I want to load image from file into pixbuf, apply some cairo
> transformations to it (for example - cairo_rotate) and then save it back
> into file. Is it possible to use cairo in that way, or cairo_rotate
> works only on vector objects?
> I tried this:
> GdkPixbuf *pbuf = gdk_pixbuf_new_from_file("g.png",NULL);
> int width = gdk_pixbuf_get_width(pbuf);
> int height = gdk_pixbuf_get_height(pbuf);
> cairo_surface_t *srf =
> cairo_t *cr = cairo_create(srf);
> gdk_cairo_set_source_pixbuf(cr, pbuf, 0, 0);
> but resulting file is the same as source file. Did i missed something?
> cairo mailing list
> cairo at cairographics.org
Counting bodies like sheep to the rhythm of the war drums.
More information about the cairo