The php website lists the following example: <?php/* Create new imagick object */$im = new Imagick();/* create red, green and blue images */$im->newImage(100, 50, "red");$im->newImage(100, 50, "green");$im->newImage(100, 50, "blue");/* Append the images into one */$im->resetIterator();$combined = $im->appendImages(true);/* Output the image */$combined->setImageFormat("png");header("Content-Type: image/png");echo $combined;?>我该如何使用从URL生成的图像,例如How do I use an image generated from a URL instead, such as $image = new Imagick("sampleImage.jpg");以便我可以附加加载的图像,而不是使用 newImage() so that I could append the loaded images instead of using newImage()推荐答案使用 Imagick :: addImage 将各种Imagicks组合"为一个,然后使用 appendImages ,例如(从此处):Use Imagick::addImage to "combine" the various Imagicks into one and use appendImages afterwards, for example (addapted from here):<?php$filelist = array("fileitem1.png","fileitem2.png","fileitem3.png");$all = new Imagick();foreach($filelist as $file){ $im = new Imagick($file); $all->addImage($im);}/* Append the images into one */$all->resetIterator();$combined = $all->appendImages(true);/* Output the image */$combined->setImageFormat("png");header("Content-Type: image/png");echo $combined;?> 这篇关于如何添加已使用appendImage创建的图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 10-28 21:47