From pykde Mon Mar 13 19:31:43 2006 From: Andreas Pakulat Date: Mon, 13 Mar 2006 19:31:43 +0000 To: pykde Subject: Re: [PyKDE] PyQt4: Problems with QImage.loadFromData(data) Message-Id: <20060313193143.GA15257 () morpheus ! apaku ! dnsalias ! org> X-MARC-Message: https://marc.info/?l=pykde&m=114227836114138 On 13.03.06 18:33:32, com@heuel.org wrote: > Dear all > > I would like to use the function loadFromData of QImage, specifically > with PIL. But the code > > [...] > imagePIL = Image.open(fileName) # e.g. a PNG file > data = self.imagePIL.tostring() # this should > contain the data > > image = QtGui.QImage() > image.loadFromData(data) > > [...] > > Why doesn't this work? Have you checked what tostring() returns? Here I don't get something that looks like an image (4K of mostly 00) Also I don't think you can convert this easily, it might be easier to write out to a temporary file and read that one back in. Andreas -- You will inherit some money or a small piece of land. _______________________________________________ PyKDE mailing list PyKDE@mats.imk.fraunhofer.de http://mats.imk.fraunhofer.de/mailman/listinfo/pykde