The picture looks green with QImage
The pBuf is from web camera. Please see below:
QImage image(pBuff, 320, 240, 320*3, QImage::Format_RGB888);
mpLbl->setPixmap(QPixmap::fromImage(image));
The label can display this vedio successful, but it looks green against to normal.
What is the problem?
Re: The picture looks green with QImage
Perhaps your webcam produces BGR-frames? In that case try
Code:
mpLbl
->setPixmap
(QPixmap::fromImage(image.
rgbSwapped()));
Re: The picture looks green with QImage
Quote:
Originally Posted by
hobbyist
Perhaps your webcam produces BGR-frames? In that case try
Code:
mpLbl
->setPixmap
(QPixmap::fromImage(image.
rgbSwapped()));
That is the problem, it is OK now, thanks!