One of the selling points for choosing Matlab when implementing the phenological annotation tool was the ease with which one could create pan zoom actions on an image. Now that I have fresh ideas to continue the annotation tool development, I wanted to give other frameworks a try. So I set off to try to implement (or download an implementation) of a pan/zoom mini application. I needed something that could zoom in/out smoothly while at the same time pan the image in whatever zoom level. These two functionalities had to work for images that were a bit on the big side: 22 megs (I know that this is nothing compared to GIS images, but it still needs to be done correctly).
I started with Qt and found an example here. I was very excited to see that it was very smooth on the example. But when I replaced the generated image with one of my 22 meg pictures, I got a disappointing surprise: When scaled out of its original zoom level, the pan and the zoom where very jumpy. I threw all kinds of tricks at it too see if I could make it smoother. Along the way I found some people who were having the same problem (here, here and here). None of those links gave me a solution that was satisfactory.
Today, after getting extremely frustrated with the QT example, I decided to switch to Gtk and see what it had to offer. I manged to create a working example with a very smooth zooming and panning of my 22 meg picture. The code I used is part of the test directory of the GtkImageViewer project. I still have to see how easy it is to place (and keep track) of additional objects in the canvas; but I think that Gtk is the way to go.
http://en.wikipedia.org/wiki/Deep_Zoom
Hey John
Thx for the tip :). I considered this method but my images are not That big. I 22 megabyte image can be handled smoothly without the need of tiling.
Cheers
Nice that you found my gtk image viewer widget. I was in the same situation as you a number of years ago when I found that nothing was fast and smooth enough for me, which is why I wrote my own widget.
Note that I have recently ported the gtk-image-viewer to Qt, which you may find at https://github.com/dov/Qviv .
Good luck!
Pingback: Pan, Zoom with Qt | Joel's Blog