[cairo] Pycairo + PNG Output

James Mills prologic at shortcircuit.net.au
Wed Oct 12 02:58:25 PDT 2005


On Wed, Oct 12, 2005 at 12:34:16AM -0700, Vladimir Vukicevic wrote:
> > So I presume now with this change we can do:
> >
> > import cairo
> > import pygame
> >
> > surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, 100, 100)
> > import StringIO
> > buffer = StringIO.StringIO()
> > image = pygame.image.frombuffer(buffer)
> 
> I'm assuming there's some kind of write_to_png(buffer) call right
> before the pygame.image.frombuffer?

Err yes, soryr my bad :)

> Ideally, you really want pycairo to allocate its own buffer for the
> cairo image surface, and let you access it, to pass it to pygame
> directly as a 32-bbp ARGB image.  Otherwise, you waste lots of CPU
> doing png encoding/decoding for no reason, especially if you do this
> often...

Yeeesss!!! HOw do I do this ? :)

cheers
James

-- 
--
-"Problems are Solved by Method"
-
- James Mills <prologic at shortcircuit.net.au>
- HomePage: http://shortcircuit.net.au/~prologic/
- Phone: +61732166379
- Mobile: +61404270962
- Skype: therealprologic
- MSN: prologic at shortcircuit.net.au
- ICQ: 98888663
- IRC: irc://shortcircuit.net.au#se

Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html


More information about the cairo mailing list