yagabey
25th December 2014, 22:17
Hi,
I need to read a QImage data into QMovie. QImage may contain a gif, png or jpg file.. If i use filepath instead of QImage:
movie->setFileName("path")
everything goes well. I couldnt figure out how to do that for QImage. In the following code "state" returns true but "Movie->isValid()" returns false:
QByteArray ba;
QBuffer buffer(&ba);
buffer.open(QIODevice::WriteOnly);
bool state= image->save(&buffer,"PNG");
Movie = new QMovie(&buffer);
Any idea?
Thanks in advance...
I need to read a QImage data into QMovie. QImage may contain a gif, png or jpg file.. If i use filepath instead of QImage:
movie->setFileName("path")
everything goes well. I couldnt figure out how to do that for QImage. In the following code "state" returns true but "Movie->isValid()" returns false:
QByteArray ba;
QBuffer buffer(&ba);
buffer.open(QIODevice::WriteOnly);
bool state= image->save(&buffer,"PNG");
Movie = new QMovie(&buffer);
Any idea?
Thanks in advance...