Re: Animations

Steve Lamont (spl@szechuan.ucsd.edu)
Tue, 18 Mar 97 07:18:54 PST

To subscribers of the xforms list from spl@szechuan.ucsd.edu (Steve Lamont) :

> In a program that I'm writing, I need to show an animation with
> 600X600 pixmaps. The problem is that this is terribly slow and I
> suspect that it has to do with the picture being sent back and forth
> between the server and the client. I don't know what it would be
> that takes about two seconds in the process else...

If you're converting the image to a Pixmap with XPutImage() every time
you display it, you're taking a pretty large hit as the client copies
the image to the server.

If this is a 'flipbook' type animation, meaning that the images are
already computed and are just displayed in a movie loop, then convert
them all to Pixmaps at the beginning of your program and just
commutate through the array of Pixmaps. My favorite way of doing this
is to create an Xforms Canvas object and use the
XSetWindowBackgroundPixmap() function call to blat the Pixmap to the
display. You may also need to call XClearWindow() to get the server
to do the update when you want it.

As long as you have enough real memory to contain all of the Pixmaps,
you should be able to achieve decent animation speeds. The animate
program from the ImageMagick toolkit does something like this and it
works really well.

spl
_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil or see
http://bob.usuf2.usuhs.mil/mailserv/xforms.html
Xforms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/xforms-archive/