哈希空间 Ctrl + F 进行搜索
首页 php手册中文版 CSS中文手册 哈希文档 Markdown在线工具

ImagickDraw::composite

(PECL imagick 2, PECL imagick 3)

ImagickDraw::compositeComposites an image onto the current image

说明

public ImagickDraw::composite(
    int $compose,
    float $x,
    float $y,
    float $width,
    float $height,
    Imagick $compositeWand
): bool
警告

本函数还未编写文档,仅有参数列表。

Composites an image onto the current image, using the specified composition operator, specified position, and at the specified size.

参数

compose

composition operator. One of the Composite Operator constant (imagick::COMPOSITE_*).

x

x coordinate of the top left corner.

y

y coordinate of the top left corner.

width

width of the composition image.

height

height of the composition image.

compositeWand

the Imagick object where composition image is taken from.

返回值

成功时返回 true

范例

示例 #1 ImagickDraw::composite() example

<?php
function composite($strokeColor$fillColor$backgroundColor) {

    
$draw = new \ImagickDraw();

    
$draw->setStrokeColor($strokeColor);
    
$draw->setFillColor($fillColor);
    
$draw->setFillOpacity(1);
    
$draw->setStrokeWidth(2);
    
$draw->setFontSize(72);
    
$draw->setStrokeOpacity(1);
    
$draw->setStrokeColor($strokeColor);
    
$draw->setStrokeWidth(2);
    
$draw->setFont("../fonts/CANDY.TTF");
    
$draw->setFontSize(140);
    
$draw->rectangle(001000300);
    
$draw->setFillColor('white');
    
$draw->setfillopacity(1);
    
$draw->annotation(50180"Lorem Ipsum!");

    
//Create an image object which the draw commands can be rendered into
    
$imagick = new \Imagick();
    
$imagick->newImage(1000302$backgroundColor);
    
$imagick->setImageFormat("png");

    
//Render the draw commands in the ImagickDraw object 
    //into the image.
    
$imagick->drawImage($draw);

    
//Send the image to the browser
    
header("Content-Type: image/png");
    echo 
$imagick->getImageBlob();
}

?>
打开 哈希空间 微信小程序中查看更佳