ariya.io About Talks Articles

introducing PhotoFlow

2 min read

As I wrote before, the obvious complaints people are having after trying out Chad’s precompiled PictureFlow for Windows Mobile are (1) slow start-up and (2) memory footprint. These stem from the fact that the example demo program that I included was written for clarity so that you can get your feet wet quickly. To overcome the initial loading and memory consumption problem, of course you have to attack the problem from a different point of view.

So here it comes: PhotoFlow. It is a small application for view images and photos, designed to run on mobile devices –like those HTC smartphones, other Windows Mobile phones, Qtopia-based handsets etc– although you can test it of course on the desktop (but I will focus on the intended target platform only). The usual trick employed here is the so-called “delayed loading”. PhotoFlow never attempts to load, resize, and prepare an image to be rendered if that image is not in the vicinity of the user’s view. Thus, it starts rather instantly and won’t suck hundred of MBs of the precious memory space. This is even done without changing anything in the original PictureFlow widget, we just need to subclass it and handle several things smartly.

Because I am (still) insane, PhotoFlow supports both Qt/Qtopia 4 and the old Qt/Embedded 2.3 (actually also Qt 3, for which there isn’t any embedded version) with a single code base. Also the delayed loading part has two versions: with and without QThread. Of course the former is better but some platforms with Qt/E (or even Qtopia, if you want) might not support threading at all, hence the latter.

Get it while it’s hot and flood my inbox with your flames.

♡ this article? Explore more articles and follow me Twitter.

Share this on Twitter Facebook