Routines (alphabetical) > Routines: I > ITRANSLATE

# ITRANSLATE

## Examples

In the following example, we draw a circle over a JPG image, and then translate the circle to another location.

; Open the data filefile = FILEPATH('marsglobe.jpg', $

SUBDIRECTORY = ['examples', 'data'])

; Create an iTool with the image data

IIMAGE, file, /FIT_TO_VIEW

circle = [150, 120] ; Circle center

d = 15 ; Circle diameter

circleTran = [167, 100] ; Units to translate circle

text = [200, 60] ; Text label location

; Write the ellipse to the iTool's annotation layer

IELLIPSE, d, circle[0], circle[1], /DATA, $

IDENTIFIER = ellipseID, THICK=2, COLOR=[240,0,0], $

FILL_BACKGROUND=0

; Add a label

ITEXT, 'Proposed Landing Site', text[0], text[1], /DATA, $

/VISUALIZATION, ALIGNMENT = 0.5, IDENTIFIER = textID, $

COLOR=[255,255,255]

; Insert a dialog box to pause the flow of action

result = DIALOG_MESSAGE('Click OK to translate the circle.', $

/INFORMATION)

; Translate the circle to a different location

ITRANSLATE, ellipseID, circleTran[0], circleTran[1], /DATA

## Syntax

ITRANSLATE, Id [, X[, Y[, Z]]] [, /DATA | /DEVICE | /NORMAL] [, /RESET] [, TOOL=iToolID] [, X=value] [, Y=value] [, Z=value]

## Arguments

### Id

The identifier of the object to translate. If you pass a partial identifier, the IGETID function is called to retrieve the full identifier string.

### X, Y, Z

The distance to translate the specified visualization in the x, y, and z directions, specified in device coordinates unless the DATA or NORMAL keyword is specified.

## Keywords

### DATA

Set this keyword if the input arguments are specified in data coordinates.

### DEVICE

Set this keyword if the input arguments are specified in device coordinates (pixels). This is the default behavior.

### NORMAL

Set this keyword if the input arguments are specified in normalized [0, 1] coordinates.

### RESET

Set this keyword to reset the current translation before applying any input translation values.

### TOOL

Set this keyword to the identifer of the iTool in which Id is found. If not supplied, the current iTool is used.

### X

Set this keyword to the distance to translate the visualization in the X direction. If this keyword is specified, the value supercedes the X argument.

### Y

Set this keyword to the distance to translate the visualization in the Y direction. If this keyword is specified, the value supercedes the Y argument.

### Z

Set this keyword to the distance to translate the visualization in the Z direction. If this keyword is specified, the value supercedes the Z argument.

Note: Z values are ignored if the DEVICE keyword is set.

## Version History

7.1 | Introduced

## See Also

IGETID, IROTATE, ISCALE, IZOOM