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

List:       pykde
Subject:    Re: [PyQt] QImage from Python buffer
From:       Phil Thompson <phil () riverbankcomputing ! com>
Date:       2008-02-24 17:25:43
Message-ID: 200802241725.44073.phil () riverbankcomputing ! com
[Download RAW message or body]

On Saturday 23 February 2008, Jeremy Sanders wrote:
> Hi -
>
> Would it be possible to add support to create a QImage from a Python buffer
> object?
>
> I want to be able to quickly convert numpy arrays to QImages for display.
> Currently I have to convert the numpy to a string, then the string to a
> QImage.
>
> it would be nice to do
>
> QImage(numpyarray.data, 100, 100, QImage.Format_RGB32)
>
> where numpyarray is a 100x100x4 8 bit array.

Tonight's SIP snapshot will allow a Python object that supports the buffer 
interface to be used whenever a char or char * is expected. No need to 
rebuild PyQt.

Phil
_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread] 

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