Skip to content

PythonQt.QtGui.QImageIOHandler

QImageIOHandler

PythonQtInstanceWrapper object

Native bases: PythonQtInstanceWrapper

Supplemental documentation: Qt 5 reference:

Detailed Description

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.

Source: https://doc.qt.io/archives/qt-5.15/qimageiohandler.html

Complete member index

Every captured member retains its own identity. Identical captured declaration text is linked once; this does not establish native inheritance or interchangeable objects.

Member Kind Signature Summary
Animation attribute Any
BackgroundColor attribute Any
ClipRect attribute Any
CompressionRatio attribute Any
Description attribute Any
Endianness attribute Any
Gamma attribute Any
ImageFormat attribute Any
ImageOption attribute type Convert a number or string to an integer, or return 0 if no arguments are given.
ImageTransformation attribute Any
IncrementalReading attribute Any
Name attribute Any (shared captured text)
OptimizedWrite attribute Any
ProgressiveScanWrite attribute Any
Quality attribute Any
ScaledClipRect attribute Any
ScaledSize attribute Any
Size attribute Any (shared captured text)
SubType attribute Any
SupportedSubTypes attribute Any
Transformation attribute type Convert a number or string to an integer, or return 0 if no arguments are given.
TransformationFlip attribute Any
TransformationFlipAndRotate90 attribute Any
TransformationMirror attribute Any
TransformationMirrorAndRotate90 attribute Any
TransformationNone attribute Any
TransformationRotate180 attribute Any
TransformationRotate270 attribute Any
TransformationRotate90 attribute Any
TransformedByDefault attribute Any
__init__ function (self, *args: Any, **kwargs: Any) -> None Native constructor; consult class documentation for supported overloads. (shared captured text)
canRead function (self) -> bool X.canRead() -> bool
className function (self, *args: Any, **kwargs: Any) -> Any Return the classname of the object (shared captured text)
currentImageNumber function (self) -> int X.currentImageNumber() -> int
currentImageRect function (self) -> Any X.currentImageRect() -> PythonQt.QtCore.QRect
delete function (self, *args: Any, **kwargs: Any) -> Any Deletes the C++ object (at your own risk, my friend!) (shared captured text)
device function (self) -> Any X.device() -> PythonQt.QtCore.QIODevice
format function (self) -> Any X.format() -> PythonQt.QtCore.QByteArray
help function (self, *args: Any, **kwargs: Any) -> Any Shows the help of available methods for this class (shared captured text)
imageCount function (self) -> int X.imageCount() -> int
inherits function (self, *args: Any, **kwargs: Any) -> Any Returns if the class inherits or is of given type name (shared captured text)
jumpToImage function (self, imageNumber: int) -> bool X.jumpToImage(imageNumber) -> bool
jumpToNextImage function (self) -> bool X.jumpToNextImage() -> bool
loopCount function (self) -> int X.loopCount() -> int
nextImageDelay function (self) -> int X.nextImageDelay() -> int
option function (self, option: Any) -> Any X.option(option) -> object
read function (self, image: Any) -> bool X.read(image) -> bool
setDevice function (self, device: Any) -> None Sets the device of the [QImageIOHandler](https://doc.qt.io/archives/qt-5.15/qimageiohandler.html) to device.
setFormat function (self, format: Any) -> None Sets the format of the [QImageIOHandler](https://doc.qt.io/archives/qt-5.15/qimageiohandler.html) to format.
setOption function (self, option: Any, value: Any) -> None X.setOption(option, value)
supportsOption function (self, option: Any) -> bool X.supportsOption(option) -> bool
write function (self, image: Any) -> bool X.write(image) -> bool