pro gifwin,n ;Created by C. See, Feb '00 ;This procedure produces a gif file for window n window=!D.window ;saves the starting window if n_params() eq 0 then n = window ;defaults to the current window wset,n ;establishes n as the current window t=tvrd() ;reads the window s=size(t) aspect=float(s(1))/s(2) if aspect lt 1.33 then y=7.5 else y=7.5*1.33/aspect ;sets for full page if t(0,0) eq 0 then t=max(t)-t ;inverts for black background ;The file in placed in the home directory as idl_windowXXXX.gif where XXXX ;incriments approx. every 10 sec. file='~/idl_window'+strmid(sstr(systime(1)),strpos(sstr(systime(1)),'.')+4,4)+'.gif' write_gif,file,t print,'Window ',sstr(n),' has been saved as: ',file wset,window ;returns to starting window end