![]()  | 
CImage:Open
The Open method loads an image from a file and attaches it to the CImage object. The image should be removed from memory using the class methods Close or delete.
| 
 bResult = CImage:Open( sPath )  | 
    sPath is the full
path specification of the image file.
    On success,
this method returns true.
    On failure,
this method returns false.
Suppose an image file exists with a full path named sPath:
| 
 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  | 
| 
 ...  | 
 -- do something  | 
| 
 I:delete()  | 
 -- when done with I, remove it from memory  |