comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Here's a stupid question...
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Here's a stupid question... [message #7173] Tue, 08 October 1996 00:00 Go to next message
gromm is currently offline  gromm
Messages: 11
Registered: July 1996
Junior Member
Hi. I have a real easy stupid question:

I am using the CW_ANIMATE widget and pixmaps. What I would like to do is
save the pixmaps to a file, so that they may be restored and played at a
later date. So, I wrote the code. Now, while I am still in my program I
restore the file and fine, no problem. However, if I close IDL and start
fresh, I get a message just as CW_ANIMATE starts loading the pixmaps to
the effect of:

"Window number 33 out of range or no more windows"

Can anyone explain the problem and/or how to fix it?

Thanks!

Gadi
Re: Here's a stupid question... [message #7204 is a reply to message #7173] Mon, 21 October 1996 00:00 Go to previous message
Peter Mason is currently offline  Peter Mason
Messages: 145
Registered: June 1996
Senior Member
On 17 Oct 1996, Gideon Z Romm wrote:
> Hi. I had posted once pefore about a problem with saving and restoring
> pixmaps for cw_animate and there was a request for some code. I kept
> getting error messages such as "Window 32 out of range or no more
> windows" Well, I don't specify the window id in my code. Mainly,
> because I am still unsure as to how cw_animate deals with all that stuff
> (setting up the window, etc.) So, I leave that up to cw_animate. I
> simply use the
>
> cw_animate_getp, animate, pixmap_vect
>
> command to save the pixmaps to a pixmpa vector called pixmap_vect. Then,
> I give the option of saving that vector, which calls on
>
> SAVE, <filename>, pixmap_vect, (and some other variables that are
> associated with the movie)
>
> then, I give a separate option to retrieve using
>
> RESTORE, <filename>
> ...
> animate=CW_ANIMATE(base, ###, ###), number_of_frames, /TRACK, $
> PIXMAPS=pixmap_vect)
>
> CW_ANIMATE_GETP, animate, pixmap_vect
> ...
> ...
> ...
>
>
> now, should I be specifying window id or something somewhere? How can I
> alleviate this problem? And can I assume that loading pixmaps is much
> faster than say if I loaded the movie into one big array and saved the
> array (which I have already tried and works but it takes about 4 minutes
> to load).


The problem here, I think, is that you can't save the contents of a
window (pixmap or other). I mean, you can't save a window without first
TVRD()'ing it or such.

CW_ANIMATE() works by first setting up a bunch of pixmap windows, one per
frame. (Apart from being invisible, pixmap windows work just like
regular windows, if you take my meaning.) It animates by copying the
pixmap windows, one at a time, to the visible window using the DEVICE
procedure. This is very fast once the pixmap windows have been set up.

Now when you "save" the pixmaps with CW_ANIMATE_GETP, all you really get
is a vector of IDs for the pixmap windows, not the windows themselves. You
also prevent these windows from being deleted once CW_ANIMATE() exits. But
they will be deleted anyway once you terminate the current IDL session.
So I think that the idea is that you can use the "saved" vector to redo the
animation later on, BUT ONLY IN THE SAME IDL SESSION. If you save this
vector to file, all you're saving is a bunch of IDs. Even if you
SAVE,/ALL, IDL won't save the pixmap windows as such. When you RESORE
in a later IDL session, all you'll have is a bunch of invalid IDs.
I think that your solution (saving one big array) might be the only sort
of thing which will work.


Peter Mason
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: RE: passing string parameter
Next Topic: Re: Activating window using cursor

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 17:39:37 PDT 2025

Total time taken to generate the page: 0.00641 seconds