[Qt-interest] Fast Scaling of Images

Jason H scorp1us at yahoo.com
Fri Apr 15 19:44:23 CEST 2011


Check your render hints, back them down until you're done scaling to the final 
resolution. 


There is also a fast scale algorithm on labs.qt.nokia.com but only works for 1/2 
sizes. In fact there are several optimization articles there.



----- Original Message ----
From: Joshua Grauman <jnfo-c at grauman.com>
To: qt-interest at qt.nokia.com
Sent: Fri, April 15, 2011 1:32:11 PM
Subject: [Qt-interest] Fast Scaling of Images

Hello all,

I'd like to include a simple image viewer in my application to view 
several pngs (around 2000 x 3000 resolution), viewed roughly full screen 
(ie. 1000 x 700 or so). I'd like to user to be able to zoom in/out and 
pan/scroll. I've seen some examples that simply use a QScrollArea with a 
QLabel to display the image. This works fine for me, but I was wondering 
if there might be a better method that would scale the images faster so 
that zoom in/out would be smoother. The examples I've seen simply use 
QLabel::resize() to do the scaling. Is this about as good as I'll get, or 
would there be a noticably faster method (reimplementing QPaintEvent??)? 
Obviously, I could cache several zoom sizes when each image is loaded, I'm 
still thinking if that would be worth it. For now I'm just seeing if there 
is a significantly faster method for doing the actual zooming than via 
QLabel::resize(). Thoughts? Thanks!

Josh
_______________________________________________
Qt-interest mailing list
Qt-interest at qt.nokia.com
http://lists.qt.nokia.com/mailman/listinfo/qt-interest




More information about the Qt-interest-old mailing list