bool QImage::save ( const QString & fileName, const char * format, int quality = -1 ) const
Saves the image to the file with the given fileName, using the given image file format and quality factor.
The quality factor must be in the range 0 to 100 or -1. Specify 0 to obtain small compressed files, 100 for large uncompressed files, and -1 (the default) to use the default settings.
Returns true if the image was successfully saved; otherwise returns false.
See also Reading and Writing Image Files.
bool QImage::save ( QIODevice * device, const char * format, int quality = -1 ) const
This is an overloaded member function, provided for convenience.
This function writes a QImage to the given device.
This can, for example, be used to save an image directly into a QByteArray:
QImage image;
QByteArray ba;
QBuffer buffer(&ba);
buffer.open(QIODevice::WriteOnly);
image.save(&buffer, "PNG"); // writes image into ba in PNG format