Creating a GIF file from a graphics window in IDL [message #20399] |
Mon, 19 June 2000 00:00  |
ykadkh1
Messages: 1 Registered: June 2000
|
Junior Member |
|
|
I was wondering if anyone knows how to write a GIF or JPEG file in IDL
using the image that appears in a window. Otherwise, it would also be
helpful If there was a way to create an array from the window's
contents. Thank you.
Yasha Kadkhodayan
Univ. of Illinois at Chicago
|
|
|
Re: Creating a GIF file from a graphics window in IDL [message #20501 is a reply to message #20399] |
Thu, 29 June 2000 00:00  |
LC's No-Spam Newsread
Messages: 18 Registered: September 1997
|
Junior Member |
|
|
>> I was wondering if anyone knows how to write a GIF or JPEG file in IDL
>> using the image that appears in a window.
yes
b=tvrd()
write_gif,filname,b,r,g,b
Where r,g,b are the component of the current lookup table. I use this
procedure to generate GIF out of graphs for use in HTML. I do not use
one of my graphics window, but the "Z device" so I can control the
lookup table without contention with other X applications, and select
the size in pixels.
set_plot,'z'
device,set_resolution=[500,400]
red=[255,0,0,0,255]
gre=[255,0,0,255,0]
blu=[255,0,255,0,0]
tvlct,red,gre,blu
... plot here
b=tvrd()
write_gif,filname,b,red,gre,blu
If I had to make an "occasional" copy of a graphic window, I'd use
either xv or xwud to grab it (as GIF or as X window dump)
--
------------------------------------------------------------ ----------
nospam@ifctr.mi.cnr.it is a newsreading account used by more persons to
avoid unwanted spam. Any mail returning to this address will be rejected.
Users can disclose their e-mail address in the article if they wish so.
|
|
|
Re: Creating a GIF file from a graphics window in IDL [message #20512 is a reply to message #20399] |
Wed, 28 June 2000 00:00  |
Paul van Delst
Messages: 364 Registered: March 1997
|
Senior Member |
|
|
"Daniel, Susan y Familia" wrote:
>
> I am also looking to solve that problem for the case of multiple X
> windows. WRITE_JPG only saves one window's graph.
You should just have to "wset" to the window whose display you want to
save....you'll have to keep track of the window id's of course:
n_windows = 4
for i = 0, n_windows - 1 do begin
window, /free
if ( i eq 0 ) then $
window_id = !d.window $
else $
window_id = [ window_id, !d.window ]
endfor
and then plot/image stuf in them you can output them all in turn
for i = 0, n_windows - 1 do begin
wset, window_id[ i ]
write_jpeg, .....etc.
endfor
Of course the above is only an (poor) example.
Liam Gumley's website (http://cimss.ssec.wisc.edu/~gumley) contains IDL
info and a neato bunch of utilities to save your window to a GIF, JPEG,
etc file. I believe the utility is called saveimage.pro or something
like that. Takes the guesswork out of doing that sort of stuff.
Unfortunately the UW-Madison/SSEC server seems to be down or having
problems.
paulv
--
Paul van Delst Ph: (301) 763-8000 x7274
CIMSS @ NOAA/NCEP Fax: (301) 763-8545
Rm.202, 5200 Auth Rd. Email: pvandelst@ncep.noaa.gov
Camp Springs MD 20746
|
|
|
Re: Creating a GIF file from a graphics window in IDL [message #20518 is a reply to message #20399] |
Wed, 28 June 2000 00:00  |
Daniel, Susan y Famil
Messages: 1 Registered: June 2000
|
Junior Member |
|
|
I am also looking to solve that problem for the case of multiple X
windows. WRITE_JPG only saves one window's graph.
Daniel
ykadkh1@uic.edu wrote:
> I was wondering if anyone knows how to write a GIF or JPEG file in IDL
> using the image that appears in a window. Otherwise, it would also be
> helpful If there was a way to create an array from the window's
> contents. Thank you.
>
> Yasha Kadkhodayan
> Univ. of Illinois at Chicago
|
|
|