The XINTERANIMATE procedure displays an animated sequence of images using off-screen pixmaps or memory buffers. The speed and direction of the display can be adjusted using the widget interface.
MPEG animation files can be created either programmatically using keywords to open and save a file, or interactively using the widget interface.
This routine is written in the IDL language. Its source code can be found in the file
subdirectory of the IDL distribution.
Displaying an animated series of images using XINTERANIMATE requires at least three calls to the routine: one to initialize the animation widget, one to load images, and one to display the images. When initialized using the SET keyword, XINTERANIMATE creates an approximately square pixmap or memory buffer, large enough to contain the requested number of frames of the requested size. Images are loaded using the IMAGE and FRAME keywords. Finally, images are displayed by copying them from the pixmap or memory buffer to the visible draw widget.
See CW_ANIMATE for a description of the widget interface controls used by XINTERANIMATE.
A value between 0 and 100 that represents the speed of the animation as a percentage of the maximum display rate. The fastest animation is with a value of 100 and the slowest is with a value of 0. The default animation rate is 100. The animation must be initialized using the SET keyword before calling XINTERANIMATE with a rate value.
The following keywords are used to initialize the animation display. The SET keyword must be provided. Other keywords described in this section are optional; note that they work only when SET is specified.
Set this keyword to a three-element vector [ Sizex , Sizey , Nframes ] to initialize XINTERANIMATE. Sizex and Sizey represent the width and height of the images to be displayed, in pixels. Nframes is the number of frames in the animation sequence. Note that Nframes must be at least 2 frames.
Set this keyword equal to zero to have XMANAGER block when this application is registered. By default, NO_BLOCK is set equal to one, providing access to the command line if active command line processing is available. Note that setting NO_BLOCK=0 will cause all widget applications to block, not just this application. For more information, see the documentation for the NO_BLOCK keyword to XMANAGER .
When this keyword is specified, an image is copied from an existing window to the animation pixmap or memory buffer. (When using some windowing systems, using this keyword is much faster than reading from the display and then calling XINTERANIMATE with a 2D array.)
The value of this parameter is either an IDL window number (in which case the entire window is copied), or a vector containing the window index and the rectangular bounds of the area to be copied. For example:
Set this keyword to delete the offscreen pixmaps or buffers and the animation widget itself. This also takes place automatically when the user presses the "Done With Animation" button or closes the window with the window manager.
If this keyword is set, XINTERANIMATE will not destroy the animation pixmaps or buffers when it is killed. Calling XINTERANIMATE again without going through the SET and LOAD steps will play the same animation without the overhead of creating the pixmaps.
Enter the following commands to open the file
(a series of images of a human heart) and animate the images it contains using XINTERANIMATE. For a more detailed example of using XINTERANIMATE, see the example in the "Using IDL Widgets" chapter of