php教程

Imagick::writeImages

(PECL imagick 0.9.0-0.9.9)

Imagick::writeImagesWrites an image or image sequence

说明

Imagick::writeImages ( string $filename , bool $adjoin ) : bool

Writes an image or image sequence.

参数

filename

adjoin

返回值

成功时返回 TRUE

User Contributed Notes

Malou 16-Jan-2010 01:25
As mbrugue sugest, the second parameter can also be use to save an animated gif:

<?php
$anim
= new Imagick();

$files = scandir($myFramesPath);
   
foreach(
$files as $f )
{
   
$auxIMG = new Imagick();
   
$auxIMG->readImage($mytifspath.$f);
   
   
$anim->addImage($auxIMG);
}

//write animated gif
$anim->writeImages('anim.gif', true);

?>
mbrugue 11-Jun-2009 02:54
The second parameter spicifies if the object is write in multipage file (true) or split every page in a single file (false).

Example:

<?php
$multiTIFF
= new Imagick();

$files = scandir($mytifspath);
   
foreach(
$files as $f )
{
   
$auxIMG = new Imagick();
   
$auxIMG->readImage($mytifspath.$f);
   
   
$multiTIFF->addImage($auxIMG);
}

//file multi.TIF
$multiTIFF->writeImages('multi.TIF', true);

//files multi-0.TIF, multi-1.TIF, ...
$multiTIFF->writeImages('multi.TIF', false);
?>

CopyRight © 2008-2022 verySource.Com All Rights reserved. 京ICP备17048824号-1 京公网安备:11010502034788