![]() |
Home · Overviews · Examples | ![]() |
The QImageIOHandler class defines the common image I/O interface for all image formats in Qt. More...
The QImageIOHandler class defines the common image I/O interface for all image formats in Qt.
Qt uses QImageIOHandler for reading and writing images through QImageReader and QImageWriter. You can also derive from this class to write your own image format handler using Qt's plugin mechanism.
Call setDevice to assign a device to the handler, and setFormat to assign a format to it. One QImageIOHandler may support more than one image format. canRead returns true if an image can be read from the device, and read and write return true if reading or writing an image was completed successfully.
QImageIOHandler also has support for animations formats, through the functions loopCount, imageCount, nextImageDelay and currentImageNumber.
In order to determine what options an image handler supports, Qt will call supportsOption and setOption. Make sure to reimplement these functions if you can provide support for any of the options in the ImageOption enum.
To write your own image handler, you must at least reimplement canRead and read. Then create a QImageIOPlugin that can create the handler. Finally, install your plugin, and QImageReader and QImageWriter will then automatically load the plugin, and start using it.
See also QImageIOPlugin, QImageReader, and QImageWriter.
Copyright © 2008 Trolltech | Trademarks | Qt Jambi 4.3.4_01 |