我有我填寫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.