Determining IDL Visual Class and Depth
QUESTION: How can I determine if the version of IDL I am running is set up for 24-bit color as opposed to 8-bit color?
![]()
ANSWER: You can determine the current IDL visual class and visual depth with two new (in IDL 5.1 and only partially documented) keywords to the Device command. The keywords are Get_Visual_Name and Get_Visual_Depth.
The visual name tells you whether you have an 8-bit visual class (e.g., PseudoColor), or a 24-bit visual class (e.g., TrueColor or DirectColor). The visual depth tells you whether you have 8-bit depth or 24-bit depth. These two keywords are output keywords that return values into named variables. They can be used like this:
IDL> Device, Get_Visual_Name=thisName, Get_Visual_Depth=thisDepth
IDL> Print, thisName, thisDepth
PseudoColor 8
![]()
Copyright © 1997 David W. Fanning
Last Updated 27 July 1998
