PDA

View Full Version : Serializing QImage



lukass
26th October 2010, 18:54
In qt doc:
http://doc.qt.nokia.com/4.7/datastreamformat.html
is written:

... If you want control of the format, stream the image into a QBuffer (using QImageIO) and stream that.

Can anyone explain me how can I "stream the image into a QBuffer (using QImageIO) and stream that"?(Maybe some minimal C++ example?)

wysota
26th October 2010, 18:58
QBuffer buffer;
image.save(&buffer, "PNG");
QDataStream stream;
// ...
stream << buffer.data();