This routine only works with ENVI Classic display groups and cannot be used with the ENVI display or in code that starts the application with the ENVI function.

This procedure queries and returns display information from a display group. An interactive ENVI Classic session is required to run this procedure.

Syntax


ENVI_DISP_QUERY, DN, COLOR={0 | 2 | 8}, FID=file ID, NL=variable, NS=variable, POS=array [, /REBIN=variable] [, /W1=variable] [, /X0=value], /XDS=variable [, /Y0=value], /YDS=variable [, /ZFACT=variable]

Arguments


DN

This keyword cannot be used to reference the ENVI display. It is only for use with ENVI Classic display groups.

This is the display number corresponding to an open display group. Display numbers (DNs) are zero-based; Display #1 corresponds to DN=0. You can retrieve DNs in the event handler of user-managed display events. For example, use the following code to retrieve the uvalue for ev.top:

widget_control, ev.top, get_uvalue=dn

Keywords


COLOR

Use this keyword to specify a named variable that contains the display color information. The valid values for COLOR are as follows:

  • 0: Gray scale image
  • 2: Classification image
  • 8: Three-band image

FID

Use this keyword to specify a named variable that contains the file ID for the open file. This value is returned from the keyword R_FID in the ENVI_OPEN_FILE procedure. FID is a three-element array of long integers. For gray scale and classification images, only the first array element is valid. For RGB displays, each FID element relates to the red (0), green (1), and blue (2) bands. An invalid file ID is specified as -1.

NL

Use this keyword to specify a named variable that contains the number of lines in the file.

NS

Use this keyword to specify a named variable that contains the number of samples in the file.

POS

Use this keyword to specify a named variable that contains the band positions of the display data. POS is a three-element array of long integers. For gray scale and classification images, only the first array element is valid. For RGB displays, each POS array element relates to the red (0), green (1), and blue (2) bands.

REBIN (optional)

Use this keyword to specify a named variable that contains the resize factor currently being used in the Scroll window. If DN is valid, the resulting variable (“resize” in this case) will be a floating-point number. If the image display does not have a Scroll window (i.e., the entire image fits into the full-resolution Image window), but you use the REBIN keyword, a meaningless REBIN value is still returned.

W1 (optional)

Use this keyword to specify a named variable that contains the IDL window IDs for the Image, Zoom, and Scroll windows. If DN is valid, the resulting variable (“win” in this case) is a three-element array of long integers, where:

  • WIN[0]: Window ID of the Image window
  • WIN[1]: Window ID of the Zoom window
  • WIN[2]: Window ID of the Scroll window

Note: If there is no scroll window in the specified ENVI Classic display, WIN[2] may be equal to 0 or -1, or it may contain the window ID of an invalid display.

X0 (optional)

Use this keyword to specify the x position of the upper-left pixel of the Image window in file coordinates (zero-based numbers).

XDS

Use this keyword to specify a named variable that contains the x display size in pixels for the display group windows. XDS is a three-element array of long integers that correspond to the Image, Zoom, and Scroll windows, respectively.

Y0 (optional)

Use this keyword to specify the y position of the upper-left pixel of the Image window in file coordinates (zero-based numbers).

YDS

Use this keyword to specify a named variable that contains the x display size in pixels for the display group windows. YDS is a three-element array of long integers that correspond to the Image, Zoom, and Scroll windows, respectively.

ZFACT

Use this keyword to specify a named variable that contains the zoom factor currently being used in the Zoom window. If DN is valid, the resulting variable (“zoom” in this case) is a two-element array of integers, where:

  • ZOOM[0]: Zoom factor for the full-resolution Image window, which is always 1.
  • ZOOM[1]: Current zoom factor for the Zoom window.

Example


envi_disp_query, dn, xds=xds, yds=yds, fid=fid, color=color

API Version


4.2