[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyKDE] PyQt4: Problems with QImage.loadFromData(data)
From:       Andreas Pakulat <apaku () gmx ! de>
Date:       2006-03-13 19:31:43
Message-ID: 20060313193143.GA15257 () morpheus ! apaku ! dnsalias ! org
[Download RAW message or body]

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
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic