<div dir="ltr"><div>You may find some clue here:<br><br><a href="http://nathanhorne.com/?p=500">http://nathanhorne.com/?p=500</a><br><br><table><tbody><tr><td class=""><code>10</code></td><td class=""><code class="">#Initialize the sip uchar ptr</code></td>
</tr></tbody></table><table><tbody><tr><td class=""><code>11</code></td><td class=""><code class="">ucharptr </code><code class="">=</code> <code class="">img.bits()</code></td></tr></tbody></table><br></div>haven't tested that myself.<br>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jan 10, 2014 at 8:05 PM, iMath <span dir="ltr"><<a href="mailto:2281570025@qq.com" target="_blank">2281570025@qq.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>but this is PyQt, many functions in Qt is not available in PyQt .</div><div><div><br></div><div><br></div><div style="font-size:12px;font-family:Arial Narrow;padding:2px 0 2px 0">------------------ Original ------------------</div>
<div style="font-size:12px;background:#efefef;padding:8px"><div><b>From: </b> "zhang jian";<<a href="mailto:zhangmdev@gmail.com" target="_blank">zhangmdev@gmail.com</a>>;</div><div><b>Date: </b> Fri, Jan 10, 2014 05:48 PM</div>
<div><b>To: </b> "iMath"<<a href="mailto:2281570025@qq.com" target="_blank">2281570025@qq.com</a>>; <u></u></div><div></div><div><b>Subject: </b> Re: [PyQt] how to cast the returned pointer of QImage::scanLine(inti) to QRgb ? format is Format_RGB32</div>
</div><div><div class="h5"><div><br></div><div dir="ltr"><div>This is from the qthread examples<br><br> QImage image(resultSize, QImage::Format_RGB32);<br><br>uint *scanLine = reinterpret_cast<uint *>(image.scanLine(y));<br>
*scanLine++ = qRgb(...);<br><br></div>
qRgb is equivalent to an unsigned int.<div> <br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jan 10, 2014 at 1:20 PM, iMath <span dir="ltr"><<a href="mailto:2281570025@qq.com" target="_blank">2281570025@qq.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>how to cast the returned pointer of <h3><span><a>uchar</a></span> * QImage::<span>scanLine</span>(<span>int</span><i> i</i>)</h3>
to QRgb ? the image format is Format_RGB32</div><br>_______________________________________________<br>
PyQt mailing list <a href="mailto:PyQt@riverbankcomputing.com" target="_blank">PyQt@riverbankcomputing.com</a><br>
<a href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt" target="_blank">http://www.riverbankcomputing.com/mailman/listinfo/pyqt</a><br></blockquote></div><br></div></div></div></div></blockquote></div><br></div>