[wxPython-users] Passing Images

Phil Mayes phil at philmayes.com
Tue Sep 4 08:09:32 PDT 2007


At 02:39 AM 9/4/2007, you wrote:
>Hi,
>
>Sorry if this seems like a silly question. I am returning to wxPython 
>after a long break!
>
>I am in the process of writing a small application, or rather sets of 
>classes which I plan to use for grabbing webcam images. I am able to grab 
>the webcam image without any problem then from that create a TIFF image 
>which is subsequently saved to a file. However I also want this image to 
>be displayed in a window/frame. At present the program grabs the image 
>again from the saved file and displays this in a window. However I suspect 
>this is causing some serious slow down, especially after a few minutes for 
>some reason. However I have tried passing the TIFF object to the image in 
>the window using events and other means but I always get an error saying 
>that wx.Image expects a strong or unicode character. Is there a way to 
>pass TIFF's or other formats directly without the need to go via file 
>I/O?  I am using the standard wx.Image class to create and display images 
>on a panel.
>
>Kind regards,
>
>rod

Have you looked at cStringIO?  It emulates a file in memory.

HTH, Phil 





More information about the wxpython-users mailing list