X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 13 Sep 2011 09:47 AM by  anon
Selecting active display in software
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
13 Sep 2011 09:47 AM
    I want to give users of my ENVI tool the ability to select, from a list of existing displays, where they want the processing result to show up, i.e. get the list of existing displays via envi_get_display_numbers get the user's choice of display via widget interface make the selected display the active display send the processing result to the active display via envi_display_bands I can find no ENVI routine that sets the active display (step 3 above). I've tried calling other display routines (e.g., disp_get_location) in the hope that the display number specified for those routines would become the active display, but it doesn't. I also tried getting idl window numbers for the desired display using envi_disp_query and choosing the image window via the idl routine wset, but that doesn't work either. Has anyone come up with a way to do this (other than using undocumented routines)?

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    14 Sep 2011 11:17 AM
    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
    You are not authorized to post a reply.