[PyQt] How to display multi page TIFF with PyQt

Starglider Developer starglider.dev at gmail.com
Thu Dec 10 22:41:36 GMT 2015


I need to display a multi page tiff file with PyQt
from the search in the internet they say that Qt doesn't support
multi page TIFF.
My code only shows the first page:

    #!/usr/bin/python
    # -*- coding: utf-8 -*-
    import os
    import sys
    from PyQt4.QtGui import *

    class Dialog(QDialog):
        def __init__(self,  parent = None):
            super(Dialog,  self).__init__(parent)
            self.resize(1280, 1024)
            masterLayout = QHBoxLayout(self)
            mainLayout = QVBoxLayout()
            self.pictureLabel = QLabel()
            mainLayout.addWidget(self.pictureLabel)
            self.status_Label = QLabel('100')
            masterLayout.addLayout(mainLayout)
            self.img_refresh()

        def img_refresh(self):
            imagem = QPixmap('image.tif')
            myScaledPixmap = imagem.scaled(1280,1024)
            self.pictureLabel.setPixmap(myScaledPixmap)
            self.setWindowTitle('test')

    def main():
        app = QApplication(sys.argv)
        form = Dialog()
        form.show()
        app.exec_()

    if __name__ == '__main__':
        main()


Thank you in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20151210/5c44aeb3/attachment.html>


More information about the PyQt mailing list