PDA

View Full Version : save animate to gif



Dmitry
6th February 2006, 22:29
Hi!

I am finish Qt application. Application to provide animate.
The part of code for draw:


class Graph : public QWidget{
Q_OBJECT
public:
Graph( QWidget *parent=0, const char *name=0 );
...
};

void Graph::paintEvent( QPaintEvent * event) {
QPixmap pixmap;
QRect rect = event->rect();
pixmap.resize(rect.size().expandedTo(pixmap.size() ));
pixmap.fill("#FBFFF3");
QPainter p(&pixmap,this);
....
bitBlt(this, event->rect().topLeft(), &pixmap);

// Which code add to this for save picture to graphic-file?
}


How the animate save to gif-file?

If save to gif-file not possible, then how save series sequence
graphic files?

Thanks and sorry for my english.

axeljaeger
16th February 2006, 17:30
Both QPixmap and QImage have a save-method. First parameter is the filename to save to, second parameter is the filetype. For example, to save a pixmap as png: pixmap.save("filename.png", "PNG");

jacek
16th February 2006, 17:35
Both QPixmap and QImage have a save-method. First parameter is the filename to save to, second parameter is the filetype.
I think that the problem was how to make an animated GIF. There is a QMovie class, but it's only for reading.