Hi,
img2py script is successfully converting .gif files into script. How do I use image data in wx.animate.Animation?
wx.animate.Animation accept only string or unicode as parameter which is disk based file path.
Prashant
Hi,
img2py script is successfully converting .gif files into script. How do I use image data in wx.animate.Animation?
wx.animate.Animation accept only string or unicode as parameter which is disk based file path.
Prashant
King wrote:
img2py script is successfully converting .gif files into script. How
do I use image data in wx.animate.Animation?wx.animate.Animation accept only string or unicode as parameter which
is disk based file path.
The path of least resistance is to create a temporary file, copy the
image data to the file, and pass that name to the Animate object. Given
that, maybe you don't want to use img2py at all -- just ship the files
with your application.
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
You've got a bigger problem than needing a file path. Img2py is not maintaining all of the animation frames in the GIF image data it is creating, because it is converting the image to PNG format before encoding it. If you really need to keep the image data in the .py file then you'll need to encode each frame of the animation separately (or side by side in a single image will also work) and then use something like the Throbber class to display the animation.
On 3/9/11 3:56 PM, King wrote:
Hi,
img2py script is successfully converting .gif files into script. How do
I use image data in wx.animate.Animation?wx.animate.Animation accept only string or unicode as parameter which is
disk based file path.
--
Robin Dunn
Software Craftsman
you’ll need to encode each frame of the animation separately (or side by side in a single image will also work)
How do I do that? I mean extract all frames of gif as separate image.
Prashant
The Python Image Library, a.k.a. PIL, can split an animated GIF file into separate “frame” image files and convert them into any image file format. It can also extract the delays between each successive frame display so you can reconstruct the animation “frame rate”.
[Python Imaging Library (PIL)](http://www.pythonware.com/products/pil/#pil116)
Using PIL you need to figure out which methods return a new image object and which ones that work “in place”, that is, simply modify the existing image object. Other than this, PIL is easy to use.
Ray Pasco
On Mar 10, 8:19 pm, King animator...@gmail.com wrote:
you’ll need to encode each frame of the animation separately (or side by
side in a single image will also work)
How do I do that? I mean extract all frames of gif as separate image.Prashant