Hi,
I need to convert the QImage to QString and vise versa. before converting i need to compress the data. to compress i am using qcompress() and returns QByteArray.
qcompress() successfully returns compressed byteArray . But when i convert byteArray to QString , the string will be always empty. This may be because QByteArray object contain null character. How can i convert QByteArray to QString????
I used
QImage curImage("c:/file");
QByteArray ba;
QBuffer buffer(&ba);
buffer.open(QIODevice::WriteOnly);
curImage.save(&buffer, "BMP");
QByteArray arr = qCompress(buffer.buffer(),5);
QString str = QString(arr);
when i use last statement str will be null... but arr will have contents....
Bookmarks