Answer the question
In order to leave comments, you need to log in
How to create a bmp file and write an array of bytes there?
The bytes are stored in a QByteArray
Option to create a .bmp file using QFile successfully creates a file, but when opening such a file, an error occurs
"BMP image has bogus header data"
QFile newDoc("fileName.bmp");
if(newDoc.open(QIODevice::WriteOnly)){
newDoc.write(image_byte);
}
QImage image;
QByteArray ba;
QBuffer buffer(&ba);
buffer.open(QIODevice::WriteOnly);
image.save(&buffer, "PNG");
QImage img;
img.loadFromData(image_byte);
QPixmap px = QPixmap::fromImage(img);
img.save("my_image","BMP");
if(domElement.tagName() == "image"){
image_byte.append(domElement.text());
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question