PDA

View Full Version : Cairo Load JPEG GIF files



dosh
April 3rd, 2008, 02:21 AM
I notice there is the command cairo_image_surface_create_from_png is there an equivalent for loading JPEG or GIF files. Or is there another way like loading it via GDK and bringing it into cairo (any help much appreciated on this)

Thanks

kknd
April 3rd, 2008, 02:51 AM
I notice there is the command cairo_image_surface_create_from_png is there an equivalent for loading JPEG or GIF files. Or is there another way like loading it via GDK and bringing it into cairo (any help much appreciated on this)

Thanks

You can load a pixbuf in gdk and use it within cairo, but it is slow.

Its better to use the cairo version, like




image = Surface.createFromPng("tux.png");
cr:setSourceSurface(image, 0, 0)