[PyQt] Odd QImage behavior

David Boddie dboddie at trolltech.com
Thu Jan 29 20:39:48 GMT 2009


On Thu Jan 29 19:03:50 GMT 2009, Matt Smith wrote:

> This test case makes two numpy arrays puts a vertical stripe and then
> creates QImages.  Change either dimension to 101 instead of 100 and the
> image doesn't get painted properly.
>
> http://paste.pocoo.org/show/101921/

Right. I haven't tried it yet, but I strongly suspect that you are
encountering the restriction stated in the QImage class documentation:

 "The width and height must be specified in pixels, data must be 32-bit
  aligned, and each scanline of data in the image must also be 32-bit
  aligned."

http://www.riverbankcomputing.com/static/Docs/PyQt4/html/qimage.html#QImage-4

David


More information about the PyQt mailing list