略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: Imagick::setImageArtifact

2024-12-22

Imagick::setImageArtifact

(PECL imagick 3)

Imagick::setImageArtifactSet image artifact

说明

public Imagick::setImageArtifact(string $artifact, string $value): bool

Associates an artifact with the image. The difference between image properties and image artifacts is that properties are public and artifacts are private. 此方法在Imagick基于ImageMagick 6.5.7以上版本编译时可用。

参数

artifact

The name of the artifact

value

The value of the artifact

返回值

成功时返回 true

错误/异常

错误时抛出 ImagickException。

范例

示例 #1 Imagick::setImageArtifact()

<?php
function setImageArtifact() {

    
$src1 = new \Imagick(realpath("./images/artifact/source1.png"));
    
$src2 = new \Imagick(realpath("./images/artifact/source2.png"));

    
$src2->setImageVirtualPixelMethod(\Imagick::VIRTUALPIXELMETHOD_TRANSPARENT);
    
$src2->setImageArtifact('compose:args'"1,0,-0.5,0.5");
    
$src1->compositeImage($src2Imagick::COMPOSITE_MATHEMATICS00);
    
    
$src1->setImageFormat('png');
    
header("Content-Type: image/png");
    echo 
$src1->getImagesBlob();
}

?>

参见

add a noteadd a note

User Contributed Notes

There are no user contributed notes for this page.

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

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