[pygtk] How to add pixbuf into cairo ImageSurface?

Luis Gonzalez ghempresa at hotmail.com
Sat Dec 27 23:50:48 WST 2008


Hi,

I am doing some test in cairo.

Well i made a cairo.ImageSurface(cairo.FORMAT_ARGB32, WIDTH, HEIGHT) and now i want to add a pixbuf into it.

So i try to do : 

context = cairo.Context(imgSurface1)

imgSurface2 = cairo.ImageSurface.create_for_data(
pixbuf.get_pixels_array(), 
cairo.FORMAT_ARGB32,
pixbuf.get_width(),
pixbuf.get_height(), 
pixbuf.get_rowstride())
context.set_source_surface(imgSurface2, 0, 0)

I add imgSurface2(pixbuf) into imgSurface1 , but imgSurface2 shows awful.

Anyway to add pixbuf into cairo ImageSurface?

Thanks.

_________________________________________________________________
More than messages–check out the rest of the Windows Live™.
http://www.microsoft.com/windows/windowslive/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20081227/8be36061/attachment.htm 


More information about the pygtk mailing list