views:

52

answers:

2

Hi,

I need a function for zooming very large images (5000 x 7000 pixel) in pyqt.

I´ve tried out the functions from gwenview (Image viewer coded in C++ and Qt), but it`s too difficult for me to understand.

Thanks!

A: 
Moayyad Yaghi
in your case , i think adding an label , setting a pixmap for that label. (like the image viewer) . then use the wheel event above ( with scaling the label instead of (self) .) will be enough
Moayyad Yaghi
This way is the first i tried, but it`s to slow for large images. It takes over 5 sec for a zoom-step. Not very efficient :)
SoHo
did you try the QGraphicView method ?,i think it will be faster .
Moayyad Yaghi
yes i`ve tried this too --> 4 sec for one zoom step :)
SoHo
A: 

In my app I have a grid which I hide when the user zooms out beyond a certain point. I acheived this by sending a signal of the zoom level whenever it changes, and catching that in a slot in the scene to enable or diable the grid. You could do the same to switch image files to a lower resolution copy of the image when you're zoomed out beyond a certain point.

Simon Hibbs