I am using QPixmap
for displaying images of different sizes on a label. I have used the following code to display the image(s):
myPixmap = QtGui.QPixmap(os.path.join("data", "images", image_name))
myScaledPixmap = myPixmap.scaled(self.ui.label.size(), QtCore.Qt.KeepAspectRatio)
The above code works fine without any issue. However, the images are displayed on the left side of the label instead of the centre. Also, the scaling reduces the images further down, instead of filling the entire label.
Is it possible to display the image at the centre of label?