Link Search Menu Expand Document

Image.Save Method

Explanation Saves the image in the Writer object in the specified format.
However, it is invalid for the Image object obtained by the GetImage method of the ImageList class.
Added since Ver.5.0.4
Not supported in Mobile, AI
Call format img. Save ( writer, format,[, option1[, option2]] )
Return value None
Arguments Object writer WriterObject to save to
Integer format Specify the image format from the following values.
Constant Value Description
Image.FORMAT_BMP 0 24- bit bitmap
Image.FORMAT_JPEG 1 JPEG
Image.FORMAT_PNG 2 PNG
Any option1 When FORMAT_JPEG is specified, image quality is 100 (high) to 1 (low), default is 100.
Any option2 When FORMAT_JPEG is specified, true = progressive JPEG, default false
Exception EXT-1 Image: Save argument is invalid
EXT-26 Cannot be executed because the image does not exist
Example of use
    var fs = new FileSystem;
    var fp = fs.Open("sample.jpg", FileSystem.OPEN_WRITE);
    img.Save(fp, Image.FORMAT_JPEG, 80, true);
    
Related item