【发布时间】:2012-01-18 11:00:09
【问题描述】:
我有unsigned char* 类型的缓冲区,我用JPG 图像填充。我想使用这个缓冲区在 QLabel 中将图像绘制到我的应用程序屏幕。
我已经这样做了,但是图像不正确。
谁能告诉我最好的方法是什么?
QPixmap pix = QPixmap::fromImage(
QImage(buff, 460, 345, QImage::Format_RGB888)); //Not sure what format to use for a jpg image?
one_img->setPixmap(pix); //one_img is of type QLabel.
【问题讨论】: