CImageSet:Insert
The Insert method adds a CImage to the image set prior to a specified index. For example, to add an image at the beginning of the set, before all other members, insert at position 1. A reference to the existing CImage is saved into the image set; no memory is allocated for a new image.
CImageSet:Insert( CImage, index ) |
The CImage is inserted prior to the image set member existing at position index. This moves all the members down in the list in order to open up the new position at index. A reference to the target CImage is then saved at the new position.
Suppose a CImageSet exists with name S and that it contains 10 images. The following script fragment inserts a CImage I at index 5:
|
-- create a CImage |
|
-- use the Open dialog to get a filename |
|
-- exit the loop after hitting Cancel |
|
-- load the image |
|
-- Insert the new member at position 5 |
|
|
|
-- result: Count=11 |