首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

ImagickDraw::composite

(PECL imagick 2.0.0)

ImagickDraw::composite — Composites an image onto the current image

Description

代码语言:javascript
复制
bool ImagickDraw::composite ( int $compose , float $x , float $y , float $width , float $height , Imagick $compositeWand )

Warning

This function is currently not documented; only its argument list is available.

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

Parameters

compose

composition operator. One of COMPOSITE_ constants

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

Return Values

Returns TRUE on success.

Examples

Example #1 ImagickDraw::composite()

代码语言:javascript
复制
<?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(0,?0,?1000,?300);
????$draw->setFillColor('white');
????$draw->setfillopacity(1);
????$draw->annotation(50,?180,?"Lorem?Ipsum!");

????//Create?an?image?object?which?the?draw?commands?can?be?rendered?into
????$imagick?=?new?\Imagick();
????$imagick->newImage(1000,?302,?$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();
}

?>

← ImagickDraw::comment

ImagickDraw::__construct →

代码语言:txt
复制
 ? 1997–2017 The PHP Documentation Group

Licensed under the Creative Commons Attribution License v3.0 or later.

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com