[PyQt] how to cast the returned pointer of QImage::scanLine(inti) to QRgb ? format is Format_RGB32

zhang jian zhangmdev at gmail.com
Fri Jan 10 12:38:11 GMT 2014


You may find some clue here:

http://nathanhorne.com/?p=500

10#Initialize the sip uchar ptr11ucharptr = img.bits()
haven't tested that myself.


On Fri, Jan 10, 2014 at 8:05 PM, iMath <2281570025 at qq.com> wrote:

> but this is PyQt, many functions in Qt is not available in PyQt .
>
>
> ------------------ Original ------------------
> *From: * "zhang jian";<zhangmdev at gmail.com>;
> *Date: * Fri, Jan 10, 2014 05:48 PM
> *To: * "iMath"<2281570025 at qq.com>;
> *Subject: * Re: [PyQt] how to cast the returned pointer of
> QImage::scanLine(inti) to QRgb ? format is Format_RGB32
>
> This is from the qthread examples
>
> QImage image(resultSize, QImage::Format_RGB32);
>
> uint *scanLine = reinterpret_cast<uint *>(image.scanLine(y));
> *scanLine++ = qRgb(...);
>
> qRgb is equivalent to an unsigned int.
>
>
>
> On Fri, Jan 10, 2014 at 1:20 PM, iMath <2281570025 at qq.com> wrote:
>
>> how to cast the returned pointer of uchar * QImage::scanLine(int* i*) to
>> QRgb ? the image format is Format_RGB32
>>
>> _______________________________________________
>> PyQt mailing list PyQt at riverbankcomputing.com
>> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20140110/ce6ea794/attachment.html>


More information about the PyQt mailing list