Code: Select all
#include <windows.h>
#include <wand/MagickWand.h>
#include "animate.h"
char *flist[] = {
"animate-00.gif",
"animate-01.gif",
"animate-02.gif",
"animate-03.gif",
"animate-04.gif",
"animate-05.gif",
"animate-06.gif",
"animate-07.gif",
"animate-08.gif",
"animate-09.gif",
"animate-10.gif",
// The list must end with a NULL pointer
NULL
};
MagickWand *mw,*rw;
void do_animation(void)
{
char **ptr;
//char temp[128];
MagickWandGenesis();
mw = NewMagickWand();
for(ptr = flist;*ptr;ptr++) {
rw = NewMagickWand();
MagickReadImage(rw,*ptr);
MagickSetImageDelay(rw,10);
MagickAddImage(mw,rw);
DestroyMagickWand(rw);
}
MagickWriteImages(mw,"animate.gif",MagickTrue);
mw = DestroyMagickWand(mw);
MagickWandTerminus();
}
And since the GIF animation had worked, I also tried to convert it to an MPG with the command line:
convert animate.gif animate.mpg
and it produces the same results as my program, a zero length file.
Am I missing any MagickWand Incantations required to get an MPG?
Pete
[edit] I forgot to mention that each gif input image is 580x480 pixels.