Hello,
Here's the output and the code:
trevor@zeppelin ~/Desktop $ cat test.py import cairo import pygame import StringIO
s = cairo.ImageSurface(cairo.FORMAT_ARGB32, 100, 100) c = cairo.Context(s)
c.set_line_width(25) c.set_source_rgba(.1, .2, .35, .5) c.move_to(0, 0) c.line_to(100, 100) c.move_to(0, 100) c.line_to(100, 0) c.stroke()
buf = StringIO.StringIO() s.write_to_png(buf)
pygame.init() pygame.display.set_mode((120, 120)) screen = pygame.display.get_surface()
size = (s.get_width(), s.get_height()) image = pygame.image.frombuffer(buf.getvalue(), size, 'ARGB').convert() image.set_colorkey((0, 0, 0))
screen.fill((160, 160, 160)) screen.blit(image, (10, 10)) pygame.display.flip()
Any suggestion would be great.
Thanks, __ Trevor Fancher http://fancher.org/
Attachment:
smime.p7s
Description: S/MIME cryptographic signature