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

Home » Public Forums » archive » Image question.
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: Image question. [message #2991 is a reply to message #2989] Thu, 13 October 1994 10:58 Go to previous messageGo to previous message
zawodny is currently offline  zawodny
Messages: 121
Registered: August 1992
Senior Member
In article <37jkfp$l7p@hacgate2.hac.com> 8015@sbsun0010.sbrc.hac.com (Mike Schienle) writes:
> In article <1994Oct12.112035.26360@msuvx1.memphis.edu>,
> PAVAN VEMULAKONDA <pvemulakonda@cc.memphis.edu> wrote:
>> How can I read an image on the screen into an integer array and store it as
>> a data file (im.dat) consisting of integer data. Plz somebody help me with
>> this.
>>
>> Thanks.
>
> If the image is already on the display, use the the TVRD() function.
> Something like:
>
> IDL> image = tvrd() ; options for size and 24-bit may be included here
> IDL> s = size(image) ; get the size of the image array
> IDL> intimage = intarr(s(1), s(2)) ; create an int array using sizes
> The '*' below allow you to fill the intimage array rather than recreate it
> IDL> intimage(*,*) = image(*,*)
> IDL> openw, lun, 'im.dat', /get_lun ; open the output file
> IDL> writeu, lun, intimage ; write the image to the output file
> IDL> free_lun, lun ; free the lun
>
> Mike Schienle

Sure this works, but why do so much work when the following will suffice:

IDL> openw, lun, 'im.dat', /get_lun ; open the output file
IDL> writeu, lun, fix(tvrd()) ; write the image to the output file
IDL> close,lun ; close the output file
IDL> free_lun, lun ; free the lun

--
Joseph M. Zawodny (KO4LW) NASA Langley Research Center
Internet: zawodny@arbd0.larc.nasa.gov MS-475, Hampton VA, 23681-0001
TCP/IP: ko4lw@ko4lw.ampr.org Packet: ko4lw@n4hog.va.usa
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: rounding function
Next Topic: Bug regarding plot limits when setting RANGE and TICKS

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

Current Time: Wed Oct 08 17:31:08 PDT 2025

Total time taken to generate the page: 0.00814 seconds