-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I am trying to write an application using pyGTK and glade-2. For part
of the user interface I want to display an image that I generate in my
python code. Here is a sample of the test code I have been using so far:
~ image = self.wTree.get_widget('image2')
~ buf=[]
~ for r in range(0, 64):
~ for g in range(0, 64):
~ buf.append('%c' % r)
~ buf.append('%c' % g)
~ buf.append('\x00')
~ imbuf = string.join(buf, '')
~ pixmap = gtk.gdk.pixmap_create_from_data(None, imbuf,
64, 64, 24, fg, bg)
~ image.set_from_pixmap(pixmap, None)
If I am understanding the manual correctly, the problem is that
pixmap_create_from_data only creates really only creates a bitmap (i.e.
one bit per pixel). The only interface I see that allows multicolor
image data without writing the data out to a file and re-reading it with
pixmap_create_from_file is gtk.gdk.pixmap_create_from_xpm_d, but it
requires putting the data into XPM format. As far as I can tell the XPM
format always needs a color map, which is pretty inconvenient because
the data I have is going to be raw 24-bit RGB numbers, with potentially
lots of different pixel values.
Is there a simple way to display raw 24-bit per pixel image with pyGTK
without first writing the data out to a file?
Thanks,
Bill Dieter.
[EMAIL PROTECTED]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFAfM3TK+wEHl1gwlQRAmqRAJ9QemCKwh4WFn5/hV4zadtabL8rBACeOFXD
QVsmQhTNebXB7REgnoCitcA=
=gTaG
-----END PGP SIGNATURE-----
_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/