There is an undocumented routine you can use to set the active display. As with all undocumented routines, there is no guarantee it will work in the same way in the future. However, it has not changed in a while. Here is an example:
To display to a specific ENVI display group, use the undocumented ENVI_ACTIVE_MNG routine to select the desired display group prior to ENVI_DISPLAY_BANDS.
envi_active_mng, DN, /set
This routine takes the DISPLAY number as the DN value. Note that this routine will crash if you pass it an invalid display group number. The DISPLAY number is different than the !d.window; it's the number of the display group. If you launch ENVI and open two display windows (Window->Start New Display), the first display group (Display #1) has a number of 0. The second is 1, etc...
Below is an example:
PRO TEST_DISPLAY_LOADING
; start ENVI and open two blank displays before proceeding
; Window -> Start New Display Window x2
; load image
fileName = FILEPATH( 'bhtmref.img', subdirectory = [ 'products', 'envi48', 'data' ] )
ENVI_OPEN_FILE, fileName
; get fid
fid = ENVI_GET_FILE_IDS()
; display to display 1
envi_active_mng, 0, /set
ENVI_DISPLAY_BANDS, fid, 0
; display to display 2
envi_active_mng, 1, /set
ENVI_DISPLAY_BANDS, fid, 0
END
|