The AddArrow method adds an arrow to an annotation set.

Example


; Start the application
e = ENVI()
 
; Open an input file
file = FILEPATH('qb_boulder_msi', $
  ROOT_DIR=e.ROOT_DIR, SUBDIRECTORY = ['data'])
raster = e.OpenRaster(file)
 
; Display the raster layer
View = e.GetView()
RasterLayer = View.CreateLayer(raster)
 
; Create an annotation set using Geographic Lat/Lon
; WGS-84 as the spatial reference
annotation = ENVIAnnotationSet(/GEOGRAPHIC)
 
annotation.AddArrow, $
  -105.20177648, $ ; arrow tail X coordinate
  40.00670857, $ ; arrow tail Y coordinate
  -105.20309187, $ ; arrow head X coordinate
  40.00777844, $ ; arrow head Y coordinate
  LINE_COLOR='lime green', $
  NAME='Open space arrow'
 
annotation.AddText, $
  -105.20053465, 40.00640980, $ ; X and Y coordinates
  'Open space', $
  GLYPH_COLOR='lime green', $
  NAME='Open space label'
 
; Save the annotation set
outFile = e.GetTemporaryFilename()
annotation.Save, outFile
 
; Display the annotation layer
AnnLayer = View.CreateLayer(annotation)

Syntax


ENVIAnnotationSet.AddArrow, X1, Y1, X2, Y2 [, Keywords=value]

Arguments


X1

Specify the X coordinate of the arrow tail.

Y1

Specify the Y coordinate of the arrow tail.

X2

Specify the X coordinate of the arrow head.

Y2

Specify the Y coordinate of the arrow head.

Keywords


ARROW_HEAD_ANGLE (optional)

Specify a floating-point angle for the arrow head. It can range from 0 to 90 degrees. The default value is 20 degrees.

ARROW_HEAD_FILL (optional)

Specify a Boolean value, indicating whether or not to fill the arrow head.

  • True: Filled (default)
  • False: Not filled

ARROW_HEAD_SIZE (optional)

Specify a floating-point size (in pixels) for the arrow head. The default value is 18 pixels.

ERROR (optional)

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.

LINE_COLOR (optional)

Specify a three-element byte array or string with the color of the arrow. The default color is based on the current ENVI preference setting.

LINE_STYLE (optional)

Specify an integer value from 0 to 6, indicating the line style of the arrow. The choices are as follows:

Value

Line Style

0

1

2

3

4

5

6

No line

The default is 0 (solid line).

LINE_THICK (optional)

Specify a floating-point value from 1 to 10, indicating the line thickness of the arrow. The default value is 2. ENVI will round the value to the nearest integer.

NAME (optional)

Set this keyword to a string with a custom name for the annotation item. This name will appear in the Layer Manager. The default value is "Arrow."

Version History


ENVI 5.6.1

Introduced

API Version


4.3

See Also


ENVIAnnotationSet