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

Home » Public Forums » archive » Re: IDL 5.0 (TvRd LoadCt) problems with true colors ???
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: IDL 5.0 (TvRd LoadCt) problems with true colors ??? [message #10832] Wed, 18 February 1998 00:00
David Foster is currently offline  David Foster
Messages: 341
Registered: January 1996
Senior Member
Kevin Ivory wrote:
>
> Rene Preusker wrote:
>>
>> I try to use true color features of idl 5.02 under
>> Linux 5.0.32 (Matrox Milenium 24 bpp). tvrd
>> gives strange results. But perhaps I understand
>> ...
>> Is there any idea what's going wrong? Are there any positive
>> expiriences with IDL, Linux and True Color?
>

You might try SAFE_TVRD.PRO, a routine I wrote when we were having
problems with TVRD() under Solaris 2.X. It uses DEVICES, COPY=[]
and a temporary pixmap. We found problems especially if you are
reading from a scrollable draw widget, but you can also have
problems if the widget is iconified or obstructed. I haven't
tested to see if the problem persisted into IDL 5.0 (we did
experience it in 4.x).

Dave

------ SAFE_TVRD.PRO -----------------------------------------------
; SAFE_TVRD.PRO 6-11-97 DSFoster
;
; 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.
;
; Modifications
;
; 6-11-97 DSF Check validity of draw widget.

FUNCTION safe_tvrd, draw_widget, xsize, ysize

on_error, 2

if (widget_info(draw_widget, /valid_id) eq 0) then begin
return, -1
endif else if (widget_info(draw_widget, /name) ne 'DRAW') then begin
return, -1
endif else begin
old_window = !d.window
window, xsize=xsize, ysize=ysize, /free, /pixmap ; New window

widget_control, draw_widget, get_value=window
device, copy=[0,0, xsize,ysize, 0,0, window] ; Copy

image = tvrd() ; Read into array
wdelete, !d.window
if (old_window ne -1) then wset, old_window
return, image
endelse

END


-------- SAFE_TVRD.DOC -------------------------------------------
SAFE_TVRD

This function replaces IDL's TVRD() function for reading the
contents of a window into an array. The TVRD() function returns
unexpected results if the window is scrollable or is obscured
onscreen. This function uses IDL's DEVICE, COPY=[] function
to more safely read the window contents.

Calling Sequence

Array = SAFE_TVRD(Draw_widget, Xsize, Ysize)

Arguments

Draw_widget

The widget id of the draw widget which you will be
reading into the array. Note that this is NOT the
window id!

Xsize, Ysize

The dimensions of the window in the draw widget.

Outputs

Array

Returns the image read from the draw widget. Returns -1
if the Draw_widget is not a valid draw widget ID.



Hope this is useful.

Dave

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
David S. Foster Univ. of California, San Diego
Programmer/Analyst Brain Image Analysis Laboratory
foster@bial1.ucsd.edu Department of Psychiatry
(619) 622-5892 8950 Via La Jolla Drive, Suite 2240
La Jolla, CA 92037
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
Re: IDL 5.0 (TvRd LoadCt) problems with true colors ??? [message #10855 is a reply to message #10832] Sat, 14 February 1998 00:00 Go to previous message
Kevin Ivory is currently offline  Kevin Ivory
Messages: 71
Registered: January 1997
Member
Rene Preusker wrote:
>
> I try to use true color features of idl 5.02 under
> Linux 5.0.32 (Matrox Milenium 24 bpp). tvrd
> gives strange results. But perhaps I understand
> ...
> Is there any idea what's going wrong? Are there any positive
> expiriences with IDL, Linux and True Color?

If you are using XFree86 3.3.1 for your Matrox Millenium card, that is
a very experimental version (I think the documentation says pre-alpha).
The most recent free version is at http://www.suse.de/XSuSE/XSuSE_E.html
(XSuSE_Matrox 1.3) but that still has a lot of bugs in the 24bpp and 32bpp
modes. I didn't check your problem with my installation because I am still
at 8bpp (IDL doesn't work in 16bpp, there is a bug with Netscape & 24bpp,
and moving windows has a bug in 32bpp) :-(

Not of much help, I guess.
Kevin
--
Kevin Ivory Tel: +49 5556 979 434
Max-Planck-Institut fuer Aeronomie Fax: +49 5556 979 240
Max-Planck-Str. 2 mailto:Kevin.Ivory@linmpi.mpg.de
D-37191 Katlenburg-Lindau, GERMANY http://www.gwdg.de/~kivory2/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: pictures without borders, full screen pictures
Next Topic: Re: Computing Speed

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

Current Time: Fri Oct 10 20:44:50 PDT 2025

Total time taken to generate the page: 0.63901 seconds