The CreatePortal function method creates and returns an object reference to a new ENVIPortal.

Example


; Start envi
e = ENVI()
 
; Open an enviRaster
filename = FILEPATH('qb_boulder_msi', SUBDIRECTORY=['data'], $
  ROOT=nv.ROOT_DIR)
raster = e.OpenRaster(filename)
 
; Get current view
view = e.GetView()
 
; Create layers with different BANDS combinations
layer1 = view.CreateLayer(raster)
layer2 = view.CreateLayer(raster, BANDS=[3,2,1])
layer3 = view.CreateLayer(raster, BANDS=[2,3,1])
layer4 = view.CreateLayer(raster, BANDS=[0,2,3])
layer5 = view.CreateLayer(raster, BANDS=[2,0,1])
 
; Create three portals
portal1 = view.CreatePortal()
portal2 = view.CreatePortal(LAYER=layer1, LOCATION=[0,0])
portal3 = view.CreatePortal(LAYER=layer2, SIZE=[200,200], $
  LOCATION=[600, 100])
 
; Turn on flicker for the portal
portal1.Animate, 1.0, /FLICKER

Syntax


Result = ENVIView.CreatePortal([, Keywords=value])

Return value


This method returns a reference to a portal object.

Arguments


None

Keywords


Keywords are applied only during the initial creation of the object.

ERROR

Set this keyword to a named variable that will contain any error message issued during execution of this routine. If no error occurs, the ERROR variable will be set to a null string (''). If an error occurs and the routine is a function, then the function result will be undefined.

When this keyword is not set and an error occurs, ENVI returns to the caller and execution halts. In this case, the error message is contained within !ERROR_STATE and can be caught using IDL's CATCH routine. See IDL Help for more information on !ERROR_STATE and CATCH.

See Manage Errors for more information on error handling in ENVI programming.

FIT_TO_VIEW

Set this keyword to create a portal that covers the entire view. If this keyword is set, the LOCATION and SIZE keywords are ignored.

LAYER

Set this keyword to an ENVIRasterLayer or ENVIVectorLayer to display that specific layer in the portal. If the LAYER keyword is not specified, the portal default behavior is to display the layer that is second down from the top in the specified view.

LOCATION

Set this keyword to an array ([x, y]) containing the display coordinates where the top-left corner of the portal will reside within the view. Coordinate [0,0] is the top-left corner of the display. By default, the top-left corner of the portal will be located in the center of the display.

PIN

Set this keyword to pin the portal to the display so that it stays in the same location when you pan the image.

SIZE

Set this keyword to an array ([width, height]) containing the size of the portal in pixels. The minimum portal size is 50 x 50 pixels.

Version History


ENVI 5

Introduced

API Version


4.3

See Also


ENVIView, ENVIPortal