Hi
I am creating a QPixmap from a QImage and saving as a bitmap using the code below. It works fine apart from the file size 6145Kb, I was expectinmg about 2048 plus a little bit for the header. It seems as though it is not storing the pixel data as 8bit.
uchar *buff=new uchar[2048*1024];
QImage imgt(2048,1024,QImage::Format_Indexed8);
//load image data
QPixmap qpt=QPixmap::fromImage(imgt);
QLabel *qptlabel = new QLabel;
qptlabel->setPixmap(qpt);
qptlabel->show();
//save file
QString filename("test.bmp");
qpt.save(filename,"BMP");
I have tried using QBitmap instead on QPixmap but this gives only black and white image
Any ideas were I am going wrong?
Best Regards
Bookmarks