Example attached. Scaling needs a little more work, as it ignores margins now (which causes garbage or doesn't allow to see all the image).
The code is for Qt4, although it should work with Qt3 as well. Just change the included files and the painter scaling and translating code.
Bookmarks