Re: TVRD() with 1024 x 1024 window: IDL or MacX 1.5 problem? [message #5668 is a reply to message #5506] |
Sun, 28 January 1996 00:00   |
joseph.b.gurman
Messages: 15 Registered: October 1995
|
Junior Member |
|
|
In article <4dos29$ebk@news1.ucsd.edu>, David Foster
<foster@bial6.ucsd.edu> wrote:
> 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
>
>
David -
Many thanks to you and others for your suggestions. As it turns out,
however,
neither RETAIN = 2 nor pixmap copying (nor the combination), nor (as some others
have suggested) making certain the graphics window is uncovered by any other
windows has any effect. Time to ping RSI.
Thanks again to all who responded,
Joe Gurman
--
| Joseph B. Gurman / NASA Goddard Space Flight Center / Solar Data Analysis| | Center/ Code 682.3 / (301) 286-4767 / joseph.b.gurman@gsfc.nasa.gov |
| (This .sig line declared non-emergency.) |
| "Excepted" = employed but unpaid. Wonder if my kids can eat that? |
|
|
|