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.

Use this procedure to move a currently selected pixel to a new location in a display group. The Zoom window will also be moved, so that it is centered on the new current pixel location. If the new current pixel location is not within the current Image window, the Image and Scroll windows will be moved so that they include the new current pixel.

Note: An interactive ENVI Classic session is required to run this procedure.





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; ENVI Classic 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

widget_control,, get_uvalue=dn


This is a named variable that contains the x location of the current pixel in zero-based file coordinates.


This is a named variable that contains the y location of the current pixel in zero-based file coordinates.


NO_WARN (optional)

Set this keyword if you do not want an error message printed when the (XFLOC, YFLOC) location is invalid for the currently displayed image. For example, if the image is (512, 512) and you specify (700, 700), an error message will be printed, unless you set /NO_WARN.


The following example moves the current pixel in the first display by 10 pixels in the X and Y directions.

  compile_opt IDL2
  ; Get all the display numbers and   
  ; check to make sure at least one
  ; display is present.
  display = envi_get_display_numbers()  
  if (display[0] eq -1) then return  
  ; Move the first display ten pixels
  ; in X and Y.  
  disp_get_location, display[0], xloc, yloc  
  disp_goto, display[0], xloc+10, yloc+10

API Version