[PyQt] Zoom or scale into an QImage

David Boddie david at boddie.org.uk
Wed Feb 11 00:02:11 GMT 2009


On Tue, 10 Feb 2009 22:45:51 +0100, Markus Feldmann wrote:

> i have an QScrollArea where i inserted a QLabel.
> This QLabel includes an QImage.
>
> I want to zoom/scale into this image.
> How can i do this?

Try one of these approaches:

1. Keep the original image and show a scaled copy in the label, making sure
that you resize the label to the size of the scaled image.

2. Alternatively, call setScaledContents(True) on the label and resize it.

The Image Viewer example takes the second approach.

David


More information about the PyQt mailing list