IMAGE_DISPLAY Procedure
Displays an image associative array.
 
note
If there are not enough colors to display the image, IMAGE_DISPLAY issues the following message:
IMAGE_DISPLAY: Not enough colors available for colormap.
The image continues to be displayed but may be lacking some colors, depending on how many are available.
 
note
If you have 64-bit PV-WAVE and need to read and write images up to 32-bits without constraints on data size, use the PHOTO OPI routines.
Usage
IMAGE_DISPLAY, image[, x, y]
IMAGE_DISPLAY, image[, position]
Input Parameters
image—An image associative array.
x, y—(optional) The lower-left x- and y-coordinates of the displayed image in the window. (See the TV procedure for more information.)
position—(optional) A number specifying the position of the image. (See the TV procedure for more information.)
Keywords
Animate—If nonzero, multiple images are displayed sequentially. The Animate keyword only applies if the image associative array contains multiple images.
Delay—A floating-point value determining the frame-to-frame delay in seconds: applies only to animations. (Default: 0.01)
Quiet—Suppresses successive levels of error messages, depending on the set value. This keyword accepts the same integer values used with the system variable !Quiet.
Sub_Img—An integer specifying the index of the subimage in the image associative array to display. (Default: 0)
Window—An integer specifying the window number. (Default: first free window number)
Keywords Relating to the Image Display (TV)
Data—Specifies that the data coordinate system be used by x and y (image position).
Device—Specifies that the device coordinate system be used by x and y (image position). This is the default if no other coordinate-system keyword is specified.
Normal—Specifies that the normal coordinate system be used by x and y (image position).
Keywords Relating to the Window
Wset—If set and the Window keyword is also specified, the image draws into the specified window. If set and the Window keyword is not specified, the image draws into the current active window.
The following keywords are only used if a new window is created; they are ignored if you use Wset and the window exists.
Bitmap—(Windows Only) Specifies that the window being created is actually an invisible portion of the display memory called a bitmap.
 
note
For cross-platform portability, use the Pixmap keyword instead of the Bitmap keyword.
Colors—The maximum number of color-table indices to be used.
 
note
The Colors keyword has an effect only if it is supplied when the first window is created; otherwise, PV‑WAVE uses all of the available color indices.
NoMeta—(Windows Only) Turns metafiles off for the window. This is the default if Animate is specified.
Pixmap—Specifies that the window being created is actually an invisible portion of the display memory called a pixmap.
Retain—Specifies how backing store for the window should be handled. (See the Retain keyword in the WINDOW procedure for more information.)
Title—If specified with a string value, then the string becomes the title of the window. If set, but no string is specified (for example, /Title), then the window title is the COMMENTS field of the image.
XPos—The x position of the lower-left corner of the new window, specified in pixels relative to the lower-left corner of the display.
XSize—The width of the window, in pixels. (Default: width of the image)
YPos—The y position of the lower-left corner of the new window, specified in pixels relative to the lower-left corner of the display.
YSize—The height of the window, in pixels. (Default: height of the image)
Discussion
The input associative array for the IMAGE_DISPLAY procedure, image, must be created by the routines IMAGE_READ or IMAGE_CREATE.
On systems where the display depth is eight or less (for example, when !D.Display_Depth 8), 24-bit images are converted to 8-bit pseudo-color before being displayed. This conversion is performed using the IMAGE_COLOR_QUANT function and does not affect the original data. However, 8-bit images may be quantized to fewer colors if there are not enough colors available to display the image. To ensure that enough colors are available, use Colors=256 when creating the first window.
 
note
The IMAGE_DISPLAY procedure generates errors, and/or will display some or all of an image outside of the window, if the window size and image position are improperly selected.
Color tables associated with the image are loaded when the image is displayed. This behavior may cause the colors in other windows to appear altered.
Do not use IMAGE_DISPLAY if your image associative array comes from a 16-bit TIFF—use the TVSCL Procedure instead.
Example
This example shows how an image associative array created with IMAGE_CREATE can be displayed with IMAGE_DISPLAY.
; Assign some pixel data (all zeros).
pixels = BYTARR(100, 200) 
; Assign a colormap (all zeros).
cmap = BYTARR(3, 50)
image = IMAGE_CREATE(pixels, File_name='test.tif', $
   Colormap=cmap, File_type='tif')
; The image is displayed as a black image.
IMAGE_DISPLAY, image
See Also
System Variables: !Quiet,  !Order