Re: [cgkit-user] cgkit.mediafile with PyQt4 and Python3
Brought to you by:
mbaas
|
From: Matthias B. <mat...@gm...> - 2013-10-10 20:32:57
|
On 09.10.13 23:30, Timothy W. Grove wrote: > Anyone with successful experience of using cgkit.mediafile with PyQt4 > and Python3 ? > [...] > # convert ndArray into a QByteArray NOTE: is this correct ??? > byteArray = QByteArray(ndArray.data.tobytes()) > img.fromData(byteArray) I have never tried passing an image from mediafile to PyQt, so I can't give you a working example, but I believe the above fromData() call expects an encoded image file, not the raw image data. So you could use it if you had a jpg image, for example, but for passing raw data, you would have to use one of the constructors that take a raw data pointer (at least if you were using C++). I'm not sure if/how that is exposed in Python though. Cheers, - Matthias - |