[wxPython-users] Passing Images
Chris Mellon
arkanes at gmail.com
Tue Sep 4 08:20:59 PDT 2007
On 9/4/07, Rod <userprogoogle-139 at yahoo.co.uk> 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.
This is certainly slower, but isn't likely to cause the symptom you're
seeing, so I suggest looking longer.
>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.
>
Assuming that your webcam library retrieves the TIFF object for you as
a Python string object:
img = wx.ImageFromStream(cStringIO.StringIO(tiffdata), wx.BITMAP_TYPE_TIF)
More information about the wxpython-users
mailing list