2

Is it possible to export images generated in Qt creator? The qimage which is a built in data type in Qt. We modify it using setpixel() function. I want to save that image for further use.

Thomas Ayoub
  • 29,063
  • 15
  • 95
  • 142
Animesh Karnewar
  • 416
  • 1
  • 8
  • 17

1 Answers1

12

You can use

bool QImage::save ( const QString & fileName, const char * format = 0, int quality = -1 ) const

To save your QImage

Saves the image to the file with the given fileName, using the given image file format and quality factor. If format is 0, QImage will attempt to guess the format by looking at fileName's suffix.

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.

Community
  • 1
  • 1
Thomas Ayoub
  • 29,063
  • 15
  • 95
  • 142