php8.5
Home/ Manual/ imagick / imagick/ Imagick::setIteratorIndex

Imagick::setIteratorIndex

PHP function Edit on GitHub ✎

(PECL imagick 2, PECL imagick 3)

Set the iterator position

Description

Imagick::setIteratorIndex(int $index): bool

Set the iterator to the position in the image list specified with the index parameter. 0x629

Parameters

index

The position to set the iterator to

Return Values

Success

Examples

Using Imagick::setIteratorIndex():

Create images, set and get the iterator index

php
<?php
$im = new Imagick();
$im->newImage(100, 100, new ImagickPixel("red"));
$im->newImage(100, 100, new ImagickPixel("green"));
$im->newImage(100, 100, new ImagickPixel("blue"));

$im->setIteratorIndex(1);
echo $im->getIteratorIndex();
?>

See Also

Source: reference/imagick/imagick/setiteratorindex.xml · from the official PHP manual (php/doc-en)