我有我填写JPG图像的unsigned char*
类型的缓冲区。我想用这个缓冲区在QLabel中将图像绘制到我的应用程序屏幕上。从无符号字符缓冲区(JPG格式)QImage
我已经这样做了,但图像不正确。
任何人都可以告诉我什么是最好的方法是?
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.