PDA

View Full Version : How to display picture from raw data without head?



luochen601
23rd July 2010, 09:40
My received pic data does not contain the head, but I know the pic information. It is the common BMP with BITMAPINFO fixed. such as:
bitmapInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bitmapInfo.bmiHeader.biPlanes = 1;
bitmapInfo.bmiHeader.biBitCount = 24;
bitmapInfo.bmiHeader.biCompression = BI_RGB;
bitmapInfo.bmiHeader.biWidth = 320;
bitmapInfo.bmiHeader.biHeight = 240;

How can I display this pic in Qt? What tools and how to use? Is QPixmap, QImage, QPicture? I know the data with head can load simply, but how about load data without head?

borisbn
23rd July 2010, 10:30
QImage ( uchar * data, int width, int height, int bytesPerLine, Format format ) (http://doc.qt.nokia.com/latest/qimage.html#QImage-6)