Saving animation images [message #5358] |
Wed, 06 December 1995 00:00  |
Justin N. Beope
Messages: 1 Registered: December 1995
|
Junior Member |
|
|
Does anyone know how to save images frames after an animation has been
completed.i.e. use cw_animate_getp to retrieve pixel maps and save each
one as its own file?
I want to use the images to view on a Mac.
I've made some progress myself, but am a little flustered at this point.
any help would be great thanks.
justin
jbeope@ece.ucsd.edu
|
|
|
Re: Saving animation images [message #5482 is a reply to message #5358] |
Fri, 08 December 1995 00:00  |
David S. Foster/Admin
Messages: 14 Registered: May 1995
|
Junior Member |
|
|
Ken Knighton <knighton> wrote:
>
> "Justin N. Beope" <jbeope> wrote:
>> Does anyone know how to save images frames after an animation has been
>> completed.i.e. use cw_animate_getp to retrieve pixel maps and save each
>> one as its own file?
>
> It seems to me that you can use cw_animate_getp to get the vector of pixmap
> window ids, then wset to each one and use tvrd to copy the contents back into a
> byte array. Once you have done that, you can just decide how you want to
> output the byte array so that you can utilize it on your Mac.
> Ken Knighton knighton@gav.gat.com knighton@cts.com
> Fusion Division
> General Atomics
> San Diego, CA
>
Be careful using the TVRD() function! On our Suns under Solaris 2.3
TVRD() can give very corrupted results, especially if your draw
widget is scrollable. I use the following SAVE_TVRD() function:
; SAFE_TVRD.PRO 9-25-95
;
; This function is a safer version of IDL's TVRD() function. First,
; there was a bug related to the reading from a scrollable draw. Also,
; the TVRD() function uses an X routine that has problems if the
; window is obscured or iconized. This routine uses the DEVICE, COPY=
; command to first copy the window contents to a new window pixmap,
; and then reads from this pixmap into the array.
FUNCTION safe_tvrd, draw_widget, xsize, ysize
on_error, 2
old_window = !d.window
window, xsize=xsize, ysize=ysize, /free, /pixmap ; Create new window
widget_control, draw_widget, get_value=window
device, copy=[0,0, xsize,ysize, 0,0, window] ; Copy into new window
image = tvrd() ; Read into array
wdelete, !d.window
if (old_window ne -1) then wset, old_window
return, image
END
Dave Foster
UCSD Brain Image Analysis Lab
|
|
|