On Sunday 09 March 2014, Lindsay Mathieson wrote: > I have a raw image buffer in xRGB format, 4 bytes per pixel, no row > padding. I’m unsure as to how to display it on screen – I played around > with Qimage, QPixmap and QLabel, but only got blank screens for my efforts > :( > > QImage *img = new QImage(_data, _width, _height, QImage::Format_RGB32); > > pix = QPixmap::fromImage(*img); > ui->lbImage->setPixmap(pix); > If you can not guarantee the liveness of _data. You should use QPixmap::fromImage(img->copy()), otherwise you might end up with a QPixmap which addresses _data.
`Allan >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<