To see some examples how the COMPOSITE_* constants work, see this page:
http://www.imagemagick.org/Usage/compose/#duff-porterImagickDraw::composite
Почист и полокален преглед на PHP референцата, со задржана структура од PHP.net и подобра читливост за примери, секции и белешки.
ImagickDraw::composite
Референца за `imagickdraw.composite.php` со подобрена типографија и навигација.
ImagickDraw::composite
(PECL imagick 2, PECL imagick 3)
ImagickDraw::composite — Composites an image onto the current image
= NULL
int
$composite,float
$x,float
$y,float
$width,float
$height,(PECL imagick 2, PECL imagick 3)
$image): bool
Оваа функција моментално не е документирана; достапна е само листата со аргументи.
Composites an image onto the current image, using the specified composition operator, specified position, and at the specified size.
Параметри
composite-
composition operator. One of the Composite Operator константа (
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.
image-
the (PECL imagick 2, PECL imagick 3) object where composition image is taken from.
Вратени вредности
Патеката до PHP скриптата што треба да се провери. 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(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();
}
?>