The code is as follows: |
Copy code |
<? Php $ Imagedraw = new imagick (); $ Pixel = new imagickpixel ('gray '); $ Pixel-> setcolor ('black '); $ Imagedraw-> newimage (100, 75, $ pixel ); $ Draw = new imagickdraw (); $ Draw-> setfont ('bookman-demiitalic '); $ Draw-> setfontsize (12 ); $ Image = new imagick (); $ Animation = new imagick (); $ Animation-> setformat ("gif "); $ Image-> readimage ("old.gif "); $ Unitl = $ image-> getimageindex (); $ Image-> writeimages('animation.gif ', false ); $ Delay = $ image-> getimagedelay (); $ Filename = 'Animation -'; For ($ I = 0; $ I <$ unitl; $ I ++ ){ $ Thisimage = new imagick (); $ Thisimage-> readimage(%filename.ii.'.gif '); $ Thisimage-> annotateimage ($ draw, 0, 12, 0, 'copyright by mpeg '); $ Animation-> addimage ($ thisimage ); $ Animation-> setimagedelay ($ delay ); } Header ("content-type: image/gif "); Echo $ animation-> getimagesblob (); ?> |
Php extension of imagemagick function. With this extension, php can have the same functions as imagemagick. Imagemagick is a powerful, stable, and free toolkit that can be used to read, write, and process image files in over 185 basic formats, including popular tiff, jpeg, gif, png, pdf, and photocd. By using imagemagick, you can dynamically generate images based on the needs of web applications. You can also resize, rotate, sharpen, subtract, or add special effects to one or more images, save the operation results in the same format or other formats.
Component download address
Http://pecl.php.net/package/imagick
Http://www.imagemagick.org