Imagick::setImageIterations

(PECL imagick 2, PECL imagick 3)

Imagick::setImageIterationsSets the image iterations

說明

public Imagick::setImageIterations(int $iterations): bool

Sets the number of iterations an animated image is repeated.

參數(shù)

iterations

The number of iterations the image should loop over. Set to '0' to loop continuously.

返回值

成功時返回 true。

錯誤/異常

錯誤時拋出 ImagickException。

范例

示例 #1 Basic Imagick::setImageIterations() usage

<?php

$imagick 
= new Imagick(realpath("Test.gif"));

$imagick $imagick->coalesceImages();
$imagick->setImageIterations(1);
$imagick $imagick->deconstructImages();

$imagick->writeImages('/path/to/save/OnceOnly.gif'true);

?>