CImage:delete CImage:Attach

CImage:Copy


The Copy method makes a copy of the CImage object, including its encapsulated image. Therefore the CImage should be terminated using Close or delete when you are done using it.

Syntax

CImage = CImage:Copy()

Example

Suppose an image file exists with a full path named sPath. The script below shows the image being opened and copied:

I = CImage:new()

-- create a CImage object

bOk = I:Open(sPath)

-- open the image from path sPath.

if not bOk then

-- if not opened, then...

  Exit()

-- leave the script, etc.

end

-- end of if block

I2 = I:Copy()

-- create a new CImage named I2

  ...

-- do something

I:delete()

-- when done with I, remove it from memory

I2:delete()

-- when done with I2, remove it from memory

Related Topics

CImage, Open, Close