Good day! I master python and pyqt. I do a photo viewer. I decided to display a picture using QPixmap in QLabel, but in this case the label is stretched to display the picture pixel-by-pixel at maximum resolution, which looks very unpleasant. Tell me what methods to use to display the image in a different size. Or is there an option - to show the redrawn image?

1 answer 1

To scale the image in QLabel you can use the QLabel.setScaledContents(bool) method. When this parameter is set to True , the picture will be adjusted to the size of your QLabel.