略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: Imagick::setImagePage

2024-12-22

Imagick::setImagePage

(PECL imagick 2, PECL imagick 3)

Imagick::setImagePageSets the page geometry of the image

说明

public Imagick::setImagePage(
    int $width,
    int $height,
    int $x,
    int $y
): bool

Sets the page geometry of the image.

参数

width

height

x

y

返回值

成功时返回 true

错误/异常

错误时抛出 ImagickException。

add a noteadd a note

User Contributed Notes 1 note

up
2
Darren Burnhill
13 years ago
This would appear to be the equivalent of +repage in ImageMagick.

<?php
  $ImagickObj
= new Imagick($sourceImagePath);
 
$ImagickObj->cropImage($_POST['w'], $_POST['h'], $_POST['x'], $_POST['y']);
 
$ImagickObj->setImagePage($_POST['w'], $_POST['h'], 0, 0);
 
$ImagickObj->writeImage($cropFilePath);
?>

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

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