On 10/28/05, Phil Thompson <[EMAIL PROTECTED] > wrote:
Yes there is. What do you mean by "doesn't work".

  Sorry for not replying sooner, I was on vacation last week. By doesn't work I mean returns the following error message:

TypeError: too many arguments to QPixmap(), 0 at most expected

Anyway, I found out why the code doesn't work: scipy.toimage returns a PIL image object, not a QImage, silly me. The
function converting a scipy array into a QImage is not in the scipy library, but in Qwt: qwt.toQImage. The following code
does work:

import scipy
import qwt
from qt import *

# imgList is a list of scipy arrays
pixmapList = [ QPixmap(qwt.toQImage(img)) for img in imgList ]

The typo in my first post was only in the post, not in my code, I used "from scipy import *" there, just
thought it'd be clearer here to add the module name.

--
Alex Borghgraef
_______________________________________________
PyKDE mailing list    [email protected]
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde

Reply via email to