[PyKDE] getting jpeg into QImage

Dave S eric3 at pusspaws.net
Fri Sep 15 22:19:07 BST 2006


Hi all,

I need to add a large company logo as the backdrop to my QTable. Googling I 
managed to work out that I need something like ...

m = QImage(file ??)
self.table1.setPaletteBackgroundPixmap(Qpixmap(m.scale(max W, max H, 
Qimage.ScaleMax))

My problem - how do I get a file into QImage ? The only examples I have found 
have large ascii files embedded into the python script eg ..

image0_data = \
    "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d" \
    "\x49\x48\x44\x52\x00\x00\x00\x40\x00\x00\x00\x40" \
...

I can open my jpeg with standard python but am stuck on how to get it into 
QImage.

Any suggestions

Dave

(PS My app looks so cool - love QT)




More information about the PyQt mailing list