QImageIO contains a QIODevice object that is used for image data I/O. The programmer can install new image file formats in addition to those that TQt provides.
Qt currently supports the following image file formats: PNG, BMP, XBM, XPM and PNM. It may also support JPEG, MNG and GIF, if specially configured during compilation. The different PNM formats are: PBM (P1 or P4), PGM (P2 or P5), and PPM (P3 or P6).
.PP
You don't normally need to use this class; QPixmap::load(), QPixmap::save(), and QImage contain sufficient functionality.
.PP
For image files that contain sequences of images, only the first is read. See QMovie for loading multiple images.
.PP
PBM, PGM, and PPM format \fIoutput\fR is always in the more condensed raw format. PPM and PGM files with more than 256 levels of intensity are scaled down when reading.
\fBWarning:\fR If you are in a country which recognizes software patents and in which Unisys holds a patent on LZW compression and/or decompression and you want to use GIF, Unisys may require you to license the technology. Such countries include Canada, Japan, the USA, France, Germany, Italy and the UK.
Defines an image I/O handler for the image format called \fIformat\fR, which is recognized using the regular expression \fIheader\fR, read using \fIreadImage\fR and written using \fIwriteImage\fR.
\fIflags\fR is a string of single-character flags for this format. The only flag defined currently is T (upper case), so the only legal value for \fIflags\fR are "T" and the empty string. The "T" flag means that the image file is a text file, and TQt should treat all newline conventions as equivalent. (XPM files and some PPM files are text files for example.)
\fIformat\fR is used to select a handler to write a QImage; \fIheader\fR is used to select a handler to read an image file.
.PP
If \fIreadImage\fR is a null pointer, the QImageIO will not be able to read images in \fIformat\fR. If \fIwriteImage\fR is a null pointer, the QImageIO will not be able to write images in \fIformat\fR. If both are null, the QImageIO object is valid but useless.
Before the regex test, all the 0 bytes in the file header are converted to 1 bytes. This is done because when TQt was ASCII-based, QRegExp could not handle 0 bytes in strings.
Note that TQt assumes that there is only one handler per format; if two handlers support the same format, TQt will choose one arbitrarily. It is not possible to have one handler support reading, and another support writing.
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns a string that specifies the image format of the image read from IO device \fId\fR, or 0 if the device cannot be read or if the format is not recognized.
.PP
Make sure that \fId\fR is at the right position in the device (for example, at the beginning of the file).
Sets the gamma value at which the image will be viewed to \fIgamma\fR. If the image format stores a gamma value for which the image is intended to be used, then this setting will be used to modify the image. Setting to 0.0 will disable gamma correction (i.e. any specification in the file will be ignored).
Although the current image formats supported by TQt ignore the parameters string, it may be used in future extensions or by contributions (for example, JPEG).
Sets the quality of the written image to \fIq\fR, related to the compression ratio.
.PP
\fIq\fR must be in the range -1..100. Specify 0 to obtain small compressed files, 100 for large uncompressed files. (-1 signifies the default compression.)
.PP
See also quality() and QImage::save().
.SH "void QImageIO::setStatus ( int status )"
Sets the image IO status to \fIstatus\fR. A non-zero value indicates an error, whereas 0 means that the IO operation was successful.
.PP
See also status().
.SH "int QImageIO::status () const"
Returns the image's IO status. A non-zero value indicates an error, whereas 0 means that the IO operation was successful.
.PP
See also setStatus().
.SH "bool QImageIO::write ()"
Writes an image to an IO device and returns TRUE if the image was successfully written; otherwise returns FALSE.
.PP
Before writing an image you must set an IO device or a file name. If both an IO device and a file name have been set, the IO device will be used.
.PP
The image will be written using the specified image format.
.PP
Example:
.PP
.nf
.br
QImageIO iio;
.br
QImage im;
.br
im = pixmap; // convert to image
.br
iio.setImage( im );
.br
iio.setFileName( "vegeburger.bmp" );
.br
iio.setFormat( "BMP" );
.br
if ( iio.write() )
.br
// returned TRUE if written successfully
.br
.fi
.PP
See also setIODevice(), setFileName(), setFormat(), read(), and QPixmap::save().
.SH "SEE ALSO"
.BR http://doc.trolltech.com/qimageio.html
.BR http://www.trolltech.com/faq/tech.html
.SH COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the
license file included in the distribution for a complete license
statement.
.SH AUTHOR
Generated automatically from the source code.
.SH BUGS
If you find a bug in Qt, please report it as described in