Originally Posted by
bmn
Can anyone help me...
I want to display sequence of frames stored in a queue as video.
30 frames or images per second
Have a look on the code from :
http://www.qt-apps.org/content/show....?content=82221
/* first you make a frame list : */
QMap<int,VIFrame> playmovie;
VIFrame Ftoc;
Ftoc.pos = playmovie.size(); /* position of frame 0= first */
Ftoc.
point = QPoint(0,
0);
/* qpoint to draw image */Ftoc.set_pics( small ); /* insert image data */
Ftoc.play = 300; /* millisecond to play 1000 = 1 sec. */
Ftoc.
bg = QColor(Qt
::black);
/* background color from frame */Ftoc.
maxframe = QRect(0,
0,small.
width(),small.
height());
/* the big area to use
or the largest image to display...
*/
playmovie.insert(Ftoc.pos,Ftoc);
/* now you can play the movie on speed you need on APNG label
http://www.qt-apps.org/content/show.php/Apng++Frame+Label?content=82221
After you have compose the Animated PNG save on resource (like demo from label) and launch the play on labeb
other way to compose frame :
https://addons.mozilla.org/en-US/firefox/addon/5519
is the same way .....
*/
/* first you make a frame list : */
QMap<int,VIFrame> playmovie;
VIFrame Ftoc;
Ftoc.pos = playmovie.size(); /* position of frame 0= first */
Ftoc.point = QPoint(0,0); /* qpoint to draw image */
Ftoc.set_pics( small ); /* insert image data */
Ftoc.play = 300; /* millisecond to play 1000 = 1 sec. */
Ftoc.bg = QColor(Qt::black); /* background color from frame */
Ftoc.maxframe = QRect(0,0,small.width(),small.height()); /* the big area
to use
or the largest image to display...
*/
playmovie.insert(Ftoc.pos,Ftoc);
/* now you can play the movie on speed you need on APNG label
http://www.qt-apps.org/content/show.php/Apng++Frame+Label?content=82221
After you have compose the Animated PNG save on resource (like demo from label) and launch the play on labeb
other way to compose frame :
https://addons.mozilla.org/en-US/firefox/addon/5519
is the same way .....
*/
To copy to clipboard, switch view to plain text mode
void set_pics( const QByteArray bytes ); /* QByteArray from image contenent as png */
void set_pics( QPixmap barcode );
void set_pics( const QPixmap * barcode );
/* you can extended to insert other image type ...*/
search " VIFrame "
on file ...
http://fop-miniscribus.googlecode.co...ameStructure.h
The list is play on this way ....
and loop forever if running is true
void PMovie::NextFrame()
{
capturescreen = false;
if (!running) {
return;
}
if ( (current + 1) > movie->framecount() ) {
current = 0;
}
VIFrame record = playmovie[current];
if (record.mode == 404) {
/* no background found on frame!!!! pos!! */
} else {
}
setWindowTitle
(QString("Play frame nr.%1 / modus %2").
arg(record.
pos + 1).
arg(record.
mode));
running = true;
setPixmap ( record.videopix() );
setScaledContents(false);
current++;
QTimer::singleShot(record.
play,
this,
SLOT(NextFrame
()));
}
void PMovie::NextFrame()
{
capturescreen = false;
if (!running) {
return;
}
if ( (current + 1) > movie->framecount() ) {
current = 0;
}
VIFrame record = playmovie[current];
if (record.mode == 404) {
/* no background found on frame!!!! pos!! */
setBackgroundRole(QPalette::Text);
} else {
setBackgroundRole(QPalette::Dark);
}
setWindowTitle(QString("Play frame nr.%1 / modus %2").arg(record.pos + 1).arg(record.mode));
running = true;
setPixmap ( record.videopix() );
setScaledContents(false);
current++;
QTimer::singleShot(record.play, this, SLOT(NextFrame()));
}
To copy to clipboard, switch view to plain text mode
Bookmarks