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

Home » Public Forums » archive » TVRD() with 1024 x 1024 window: IDL or MacX 1.5 problem?
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: TVRD() with 1024 x 1024 window: IDL or MacX 1.5 problem? [message #5625 is a reply to message #5506] Fri, 19 January 1996 00:00 Go to previous messageGo to previous message
David S. Foster/Admin is currently offline  David S. Foster/Admin
Messages: 14
Registered: May 1995
Junior Member
joseph.b.gurman@gsfc.nasa.gov (Joseph B. Gurman) wrote:
>
> I'm using IDL 4.0.1a on a DEC Alpha running OpenVMS, and using a
> PowerMac 9500/132 with a PCI display card at 1200 x 1600 resolution to be
> able to display 1024 x 1024 images without chopping off the top 46 rows
> (take a look at !d.y_vsize on a ysize = 1024 window on a 1024 x 1280
> display). Everything works OK except for TVRD --- either with explicit
> arguments or just as TVRD(), it messes up the read-back image
> significantly.
>

We have had a very similar problem with TVRD() under Solaris 2.3 .
RSI tech support verified that there were problems with the TVRD()
function. Specifically, our problem was due to TVRD's failure to
read correctly from scrollable draw widgets. RSI's answer was that
if there are regions of the canvas that are not "onscreen" (due to
scrolling, being behind another window, or being iconified), those
portions of the array can get screwed up.

They suggested playing around with backing store, as some systems
will supply it and some will not. Your window is so large that
perhaps your server is refusing. You might try forcing IDL to
provide backing-store using the RETAIN=2 keyword when you create
the draw widget.

I know that on our system this did not help, but in your case it
might do the trick. We never did get TVRD() to work properly
with scrollable draws (IDL 4.0.1), so I wrote the following
little work-around that works fine for us. Your window is so
large that performance might be an issue here.


; 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


Hope this helps. We've never had problems with TVRD() reading from
a pixmap window.


David Foster
UCSD Brain Image Analysis Lab
foster@bial1.ucsd.edu
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to draw a line on an image?
Next Topic: Re: What is JAVA? was: (Re: Compiling IDL ... ever likey ?)

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

Current Time: Fri Oct 10 22:26:06 PDT 2025

Total time taken to generate the page: 1.67667 seconds