Ver Mensaje Individual
  #14 (permalink)  
Antiguo 28/06/2010, 13:19
Nano-rosario
 
Fecha de Ingreso: abril-2008
Mensajes: 68
Antigüedad: 16 años
Puntos: 0
Respuesta: Abrir un archivo Fantasma

Con este codigo te muestra un ejemplo de como pasar una imagen del disco a strem

Código:
import  cStringIO
import  wx

class TestPanel(wx.Panel):
    def __init__(self, parent, log):
        wx.Panel.__init__(self, parent, -1)

        data = open('bitmaps/image.png', "rb").read()
        stream = cStringIO.StringIO(data)

        bmp = wx.BitmapFromImage( wx.ImageFromStream( stream ))
        wx.StaticText(
            self, -1, "This image was loaded from a Python file-like object:", 
            (15, 15)
            )

        wx.StaticBitmap(self, -1, bmp, (15, 45))#, (bmp.GetWidth(), bmp.GetHeight()))
Esto es parte del paquete de demostracion de wxPython.
Wxpython demo Descargar