[PyQt] How to use the QtGui.QImage.setColorTable()?

Grissiom chaos.proton at gmail.com
Sun Apr 6 15:11:41 BST 2008


Hi all,
I have to bother you again....Run this script:

#coding = utf-8
# file_name = test2.py
from PyQt4 import QtCore, QtGui

im = QtGui.QImage(3, 3, QtGui.QImage.Format_Indexed8)

print QtGui.qRgb(0, 0, 0), QtGui.qRgb(255, 255, 255), QtGui.qRgb(255, 0, 0)

b = QtGui.qRgb(0, 0, 0)
w = QtGui.qRgb(255, 255, 255)
r = QtGui.qRgb(255, 0, 0)
im.setColorTable([b, w, r])

print im.colorTable()
print  b, w, r

I got:
bash-3.1$ python test2.py
4278190080 4294967295 4294901760
[-1, -1, -1]
4278190080 4294967295 4294901760
bash-3.1$

So, how to use the QtGui.QImage.setColorTable()? Thanks in advance ;)
-- 
Cheers,
Grissiom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20080406/0ea74c83/attachment.html


More information about the PyQt mailing list