PDA

View Full Version : custom widgets painting image formats



TheKedge
12th March 2007, 09:19
Hello all,

I'd like to make a widget - something like the shaped clock example. Instead of drawing the thing 'by hand' I'd like to use some image - perhaps even from a photograph (whatever).

What's the image format to use?
I'd like scalability, too. I'll also be doing some very simple animation (rotating and changing colours).
Do I embed the image into a resource (I don't know anything about using them) or is it ok to load it from a file?

you guys are a great help, thanks,
K

macbeth
12th March 2007, 10:33
Just some of my thoughts:

If you want scalability, you probably won't be satisfied with a photograph... Unless you have it in good resolution and use QPainter::SmoothPixmapTransform, but even though I think that the 'numbers' would not look very good.
I would probably draw the clock in a small app on a QPicture (using various shapes) and save it then (as done here (http://doc.trolltech.com/4.2/qpicture.html#details)). You can then use and load the QPicture easily in your clock application and resize it without loosing quality...