resize image of qlabel in pyqt4

295 views Asked by At

I am opening an image with this function (menu button):

def open_file(self, currView):
    fileName = QtGui.QFileDialog.getOpenFileName(self, "Open File", QtCore.QDir.currentPath())
    if fileName:
        pixelMap = QtGui.QPixmap(fixPgmPixmap(fileName,tmpPngFilename))
        if pixelMap.isNull():
                QtGui.QMessageBox.information(self, "Image Viewer", "Cannot load %s." % fileName)
                return
        currView.setPixmap(pixelMap)
        currView.show()

currView is either leftImage or RightImage - both of them are QLabels.

after the Image is loaded I want to rescale it (zoom in\out).

but I don't succeed doing it on the Qlabel itself, do I need to do it on the pixelmap? (if so, then how?)

0

There are 0 answers