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

Home » Public Forums » archive » Re: How to directly write figure to png without open x-window in IDL5.4?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: How to directly write figure to png without open x-window in IDL5.4? [message #32834] Thu, 14 November 2002 06:47 Go to previous message
ninghai is currently offline  ninghai
Messages: 3
Registered: October 2002
Junior Member
Craig Markwardt <craigmnet@cow.physics.wisc.edu> wrote in message news:<on7kfglqx2.fsf@cow.physics.wisc.edu>...
> David Fanning <david@dfanning.com> writes:
>
>> Ninghai Sun (ninghai@whidc.com) writes:
>>
>>> Now, I first write to PS and then convert to png in cronjob. No
>>> problem in linux. But if logout of Linux when the idl code is running,
>>> always get error that no x-window is opened. Any idea how to figure it
>>> out?
>>
>> Use the Z-buffer for a window.
>>
>> thisDevice = !D.Name
>> Set_Plot, 'Z'
>> LOADCT, 5 ; of whatever you do to load colors
>> TVLCT, r, g, b, /GET
>> Device, Z_Buffer=0, Set_Resolution=[400, 300] ; or whatever
>> TV, image ; Or, whatever graphics you display
>> snapshot = TVRD()
>> Set_Plot, thisDevice
>> Write_PNG, 'myfile.png, snapshot, r, g, b

Seems this way still doesn't work in my Linux machine. When the
cronjob was running after I log out of Linux, only error msg is
returned, which is "Xlib: connection to "0:0" refused by server.
Xlib:Client is not authorized to connect to server." Is this because
IDL problem or my Linux X-win proble? I am confused.

> Speaking of being stuck in IDL 5.4, I have found that TVRD() and
> WRITE_PNG have two slightly different behaviors, depending on whether
> IDL 5.4 (or earlier), or 5.5 are used. In the earlier versions, the
> graphic is vertically flipped. In my little Z buffer PNG screen
> capture code, I have something like this to test for IDL version:
>
>
> img = tvrd()
> if float(!version.release) LT 5.5 then $
> img = reverse(img, 2)
>
> write_png, filename, img, ctab, ctab, ctab
>
> Craig

Seems it's not necessary to do so on my IDL 5.4 in linux.
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: How to directly write figure to png without open x-window in IDL5.4?
Next Topic: Martin's Library is Back!

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

Current Time: Fri Oct 10 10:15:59 PDT 2025

Total time taken to generate the page: 0.95901 seconds