[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: Best way to display live raw RGB data
From:       Allan Sandfeld Jensen <kde () carewolf ! com>
Date:       2014-03-09 11:17:50
Message-ID: 201403091217.50519.kde () carewolf ! com
[Download RAW message or body]

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 <<

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic