CImage:Dup
The Dup method makes a duplicate of the current CImage object. The new CImage object is returned to the script. If, instead, you want this CImage to contain a copy of a different CImage, use the Copy method.
CImageNew = CImage:Dup() where |
CImageNew is a new CImage object which is created and returned to the script. In place of CImage, use the name of the actual object you wish to duplicate.
On success, this method returns the new object CImageNew.
On failure, nil. is returned.
Suppose an image file exists with a full path named sPath. The script below shows the image being opened and copied:
|
-- create a CImage object |
|
-- open the image from path sPath. |
|
-- if not opened, then... |
|
-- leave the script, etc. |
|
-- end of if block |
|
-- create a new CImage object Inew |