[PyQt] 回复: 回复: 回复: how to cast the returned pointer of QImage::scanLine(int i) toQRgb ? format is Format_RGB32

Phil Thompson phil at riverbankcomputing.com
Sat Jan 11 10:08:24 GMT 2014


On 11-01-2014 9:46 am, iMath wrote:
> the test shows:
> sip.voidptr object has an unknown size

...so set it using sip.voidptr.setsize() using the result of 
QImage.bytesPerLine().

Phil

> ------------------ 原始邮件 ------------------
>
> 发件人: "phil";<phil at riverbankcomputing.com>;
> 发送时间: 2014年1月11日(星期六) 下午5:30
> 收件人: "iMath"<2281570025 at qq.com>;
> 抄送: "pyqt"<pyqt at riverbankcomputing.com>;
> 主题: Re: 回复: 回复: how to cast the returned pointer of
> QImage::scanLine(int i) toQRgb ? format is Format_RGB32
>
> On 11-01-2014 2:42 am, iMath wrote:
>> but you mentioned here
>> http://pyqt.sourceforge.net/Docs/PyQt4/gotchas.html#support-for-void
>> [1]
>>
>> A sip.voidptr may also be given a size (ie. the size of the block of
>> memory that is pointed to) by calling its setsize() method. If it
> has
>> a size then it is also able to support Python’s buffer protocol
> and
>> behaves like a Python memoryview object
>>
>> Is this mean A sip.voidptr doesn't have a size by default ? if it is
>> ,then sip.voidptr couldn't support Python’s buffer protocol,right
> ?
>
> It will support a size if it is available. I will look at this
> particular case to see if the size can be determined.
>
> Phil
> .



More information about the PyQt mailing list