basic animated gif help
Posted: 2007-03-24T13:46:08-07:00
having some difficulty creating a very basic animated gif. I'd just like to create a gif that repeatedly cycles between two frames. my code so far looks like this.
This creates a gif that cycles between img1 and img2 only once. How do I get it to repeat?
Code: Select all
$img1 = NewMagickWand();
MagickReadImage( $img1, $location1 );
MagickSetImageDelay( $img1, 200);
$img2 = NewMagickWand();
MagickReadImage( $img2, $location2 );
MagickSetImageDelay( $img2, 200);
$final = NewMagickWand();
MagickAddImage($final,$img1);
MagickAddImage($final,$img2);
MagickSetFormat($final, 'GIF');
header('Content-Type: ' . MagickGetMimeType($final));
MagickEchoImagesBlob($final);