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

Home » Public Forums » archive » Re: Saving pixmaps
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
Re: Saving pixmaps [message #9958] Sat, 20 September 1997 00:00
Joe Means is currently offline  Joe Means
Messages: 44
Registered: November 1996
Member
Peter Mason wrote:

> On Wed, 17 Sep 1997, Joe Means wrote:
>> I have run xinteranimate and saved the pixmaps. Now I want to access them
>> singly and save them to disk for a future IDL session. How?
>
> ..........
>
> Peter Mason
> CSIRO division of Exploration and Mining
> P.O Box 136, North Ryde, NSW, 2113, Australia
> E-Mail: p.mason@syd.dem.csiro.au Tel: +61 2 9490-8883 Fax: 9490-8960/8921
> Web: http://www.syd.dem.csiro.au/research/MMTG/

Peter,

Thanks for your helpful response. I did not know how to get pixmapid's or how
to copy a pixmap to a window with a device command.

I took an apporach that incorporates some of your ideas and uses xinteranimate.
I draw each image in a loop that loads xinteranimate as per IDL on line help.
In the look I TVRD each window into an image array. Upon leaving the loop I
save an array with all the images as an unformated file. Later, to run the
animation, I use ASSOC to link to the images and load them into xinteranimate.

--Joe Means

From: Joseph E. Means, Asst. Prof. (Courtesy) Forest Science Department
Internet: Means@fsl.orst.edu Oregon State University
Phone 541-750-7351 Fax 541-750-7329 Corvallis, OR 97331 U.S.A.
http://www.fsl.orst.edu/rogues/meansj/meansnew.htm
Re: Saving pixmaps [message #9966 is a reply to message #9958] Fri, 19 September 1997 00:00 Go to previous message
Peter Mason is currently offline  Peter Mason
Messages: 145
Registered: June 1996
Senior Member
On Wed, 17 Sep 1997, Joe Means wrote:
> I have run xinteranimate and saved the pixmaps. Now I want to access them
> singly and save them to disk for a future IDL session. How?

You're probably not going to be able to do quite what you would like here.
(I'm familiar with IDL 4's handling of pixmaps, but I'd be surprised if IDL 5's
handling is different...)

A pixmap is an invisible window. It has an ID and associated pixmap memory.
Pixmap memory is different to the (regular) memory associated with normal
variables. It's an entirely separate thing. The only way to set or get
it is through commands like TV, TVRD() and DEVICE.

So if you want to save a pixmap to disk, you first have to copy its memory
to a regular variable with a command like mem_var=TVRD(pixmap_id).
And to restore a "saved pixmap", you have to create the pixmap window, read
the saved data, and TV it to the pixmap window. (24-bit color complicates
TVRD() and TV a little, and 8-bit colour means that you have to save and
restore the colour table as well.)

All this is possible with CW_ANIMATE and the support routines in
CW_ANIMATE.PRO. But I think that one would have to be rather keen to take
this route, and I don't think that it would save time.
The simplest "solution" would be to regenerate the animation from scratch
in each IDL session. If the frames are quite complicated (i.e., not just
the TV'ing of images) then you could save some time (for future sessions) by
grabbing the rendered frames with TVRD() and saving them as images. You would
still have to rebuild the animation "from scratch" in future sessions, but
you'd be doing it by TV'ing images rather than rendering complicated graphics.

For saving the pixmap images, you'll need the pixmap IDs. After rendering
the frames, you can get these IDs with the command:
CW_ANIMATE_GETP, cw_animate_base_widget, pixmap_ids

Once you have the pixmap IDs, you will also be able to display individual
frames. To do this, you will first need to create a regular window or
draw widget (same size as the pixmaps), and then use DEVICE,COPY=... to copy
the pixmap window to the regular window.



Peter Mason
CSIRO division of Exploration and Mining
P.O Box 136, North Ryde, NSW, 2113, Australia
E-Mail: p.mason@syd.dem.csiro.au Tel: +61 2 9490-8883 Fax: 9490-8960/8921
Web: http://www.syd.dem.csiro.au/research/MMTG/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Problems with Insight on MacOS
Next Topic: Re: Problems with Insight on MacOS

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

Current Time: Wed Oct 08 13:32:32 PDT 2025

Total time taken to generate the page: 0.00618 seconds