CImageView:Insert


The Insert method inserts a CImage into the list of images in a CImageView. The image is inserted before the specified index.

Syntax

bSuccess = CImageView:Insert( CImage, nIndex )

where

    CImage is the image to insert.

    nIndex is the index of the insertion point, in the range 1 to Count.

    bSuccess is the returned success code. On success it is true, otherwise false.

  

The CImageView refers to a Mira image display window. The Image window uses an image set to display multiple images. This method inserts the CImage into the image set before the specified index. For example,nIndex=1 inserts the CImage before the first member of the image set.

This method fails if nIndex is out of bounds.

Example

Assume that a CImageView exists and is assigned toV. The following script inserts an image intoV at index 3 (that is, before the image at index 3):

I = CImage:new()

-- create a CImage

local sPath, bOk = GetFileName()

-- use the Open dialog to get a filename

I:Open(sPath)

-- load the image from a file named sPath

bOk = V:Insert( I, 3 )

-- insert the CImage before image 3

Related Topics

Display

Append

CImageView class

CImage class