QMovie *animGif = new QMovie(QString("images/anim.gif")); label->setMovie(animGif); animGif->start();
QByteArray bytes; QBuffer buffer(&bytes); buffer.open(QIODevice::WriteOnly);
QImage image("test.gif"); QByteArray ba; QBuffer buf(&ba); image.save(&buf, "GIF");
//Добавляем в буфер QByteArray ba; QBuffer buffer(&ba); image.save(name,"GIF"); QIODevice *dev1 = buffer; QMovie *animGif = new QMovie(dev1); btnMainPrv[i]->setMovie(animGif); animGif->start();
error: no matching function for call to 'QMovie::QMovie(QBuffer&)' ..\..\Qt\2010.04\qt\include\QtGui/../../src/gui/image/qmovie.h:152: note: candidates are: QMovie::QMovie(const QMovie&) ..\..\Qt\2010.04\qt\include\QtGui/../../src/gui/image/qmovie.h:94: note: QMovie::QMovie(const QString&, const QByteArray&, QObject*) ..\..\Qt\2010.04\qt\include\QtGui/../../src/gui/image/qmovie.h:93: note: QMovie::QMovie(QIODevice*, const QByteArray&, QObject*) ..\..\Qt\2010.04\qt\include\QtGui/../../src/gui/image/qmovie.h:92: note: QMovie::QMovie(QObject*)
QImage image; QString name = QString("images/anime.gif"); image.load(name); //Добавляем в буфер QBuffer buffer; buffer.open(QBuffer::ReadWrite); QDataStream out(&buffer); out << image; QMovie *animGif = new QMovie(&buffer); btnMainPrv[i]->setMovie(animGif); animGif->start();
QImage image; QString name = QString("images/anime.gif"); image.load(name); //Добавляем в буфер QByteArray ba; QBuffer buffer(&ba); buffer.open(QBuffer::ReadWrite); image.save(&buffer,"GIF"); QMovie *animGif = new QMovie(&buffer); label->setMovie(animGif); animGif->start();
QBuffer *bufer;
bufer = new QBuffer;
buffer.open(QBuffer::ReadWrite);
QBuffer *buffer;
buffer = new QBuffer;
QImage image; QString name = QString("images/animate.gif")); image.load(name); //Добавляем в буфер buffer->open(QBuffer::ReadWrite); image.save(&buffer,"GIF"); QMovie *animGif = new QMovie(&buffer); label->setMovie(animGif); animGif->start();
[color=red]modules\classes\mainwindow.cpp:3589: error: no matching function for call to 'QImage::save(QBuffer**, const char [4])' ..\..\Qt\2010.04\qt\include/QtGui/../../src/gui/image/qimage.h:242: note: candidates are: bool QImage::save(const QString&, const char*, int) const ..\..\Qt\2010.04\qt\include/QtGui/../../src/gui/image/qimage.h:243: note: bool QImage::save(QIODevice*, const char*, int) const modules\classes\mainwindow.cpp:3593: error: no matching function for call to 'QMovie::QMovie(QBuffer**)' ..\..\Qt\2010.04\qt\include\QtGui/../../src/gui/image/qmovie.h:152: note: candidates are: QMovie::QMovie(const QMovie&) ..\..\Qt\2010.04\qt\include\QtGui/../../src/gui/image/qmovie.h:94: note: QMovie::QMovie(const QString&, const QByteArray&, QObject*) ..\..\Qt\2010.04\qt\include\QtGui/../../src/gui/image/qmovie.h:93: note: QMovie::QMovie(QIODevice*, const QByteArray&, QObject*) ..\..\Qt\2010.04\qt\include\QtGui/../../src/gui/image/qmovie.h:92: note: QMovie::QMovie(QObject*) [/color]