CImageView:Insert
The Insert method inserts a CImage into the list of images in a CImageView. The image is inserted before the specified index.
bResult = CImageView:Insert( CImage, nIndex ) |
CImage is the image to insert.
nIndex is the index of the insertion point, in the range 1 to Count.
On success, this method returns true.
On failure, this method returns false.
The CImageView wraps 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.
Assume that a CImageView exists and is assigned toV. The following script fragment 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 |