略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: Imagick::setImageIndex

2024-11-13

Imagick::setImageIndex

(PECL imagick 2, PECL imagick 3)

Imagick::setImageIndexSet the iterator position

警告

此函数在 Imagick 3.4.4 中被 废弃,强烈建议不要应用此函数。

说明

public Imagick::setImageIndex(int $index): bool

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

This method has been deprecated. See Imagick::setIteratorIndex().

参数

index

The position to set the iterator to

返回值

成功时返回 true

错误/异常

错误时抛出 ImagickException。

add a noteadd a note

User Contributed Notes 2 notes

up
2
Rob Hidalgo
9 years ago
When reading a PDF from an ImageBlob, and you want to set the page to be used, this is the function to use.
up
-1
maulik_Vr at yahoo dot co dot in
9 years ago
when you read pdf by getImageBlog and want to get the image or blob of a specific page, use this function as below.

$ims = new Imagick();
       
$ims->readImageBlob($pdfFileContent);
       
$ims->setImageIndex(5); //this will return 6th page of the pdf file
$image->setImageFormat('png');
            //etc
$blob = $image->getImageBlob();

官方地址:https://www.php.net/manual/en/imagick.setimageindex.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3