magickSetIteratorIndex method

bool magickSetIteratorIndex(
  1. int index
)

Sets the iterator to the given position in the image list specified with the index parameter. A zero index will set the first image as current, and so on. Negative indexes can be used to specify an image relative to the end of the images in the wand, with -1 being the last image in the wand.

If the index is invalid (range too large for number of images in wand) the function will return false, but no 'exception' will be raised, as it is not actually an error. In that case the current image will not change.

After using any images added to the wand using magickAddImage() or magickReadImage() will be added after the image indexed, regardless of if a zero (first image in list) or negative index (from end) is used.

Jumping to index 0 is similar to magickResetIterator() but differs in how magickNextImage() behaves afterward.

Implementation

bool magickSetIteratorIndex(int index) =>
    _magickWandBindings.MagickSetIteratorIndex(_wandPtr, index).toBool();