On Thursday 08 May 2008 18:18, Sergi Blanch i Torné wrote:

> I want to start adding this to the sample-script. By the way in the widget, 
> after a constructor like:
> image = 
> QtGui.QImage(imgData8,imgDimX,imgDimY,imgDimX,QtGui.QImage.Format_Indexed8)
> 
> I wrote this:
> image.setNumColors(256)
> for i in range(256):
>       rgb = QtGui.QColor(i,i,i).rgb()
>       image.setColor(i,rgb)
> 
> Is this what you mention? Or you refere to create an instance of QPalette?

I think you have to set a color table using your image's setColorTable()
method:

http://www.riverbankcomputing.com/static/Docs/PyQt4/html/qimage.html#setColorTable

David
-- 
David Boddie
Lead Technical Writer, Trolltech ASA

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to