Добро пожаловать на форум PHP программистов!
За последние 24 часа нас посетили 22039 программистов и 987 роботов. Сейчас ищут 678 программистов ...
Приступая к работе

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

Вернуться к: ImagickDraw

ImagickDraw::composite

(PECL imagick 2.0.0)

ImagickDraw::compositeComposites an image onto the current image

Описание

bool ImagickDraw::composite ( int $compose , float $x , float $y , float $width , float $height , Imagick $compositeWand )
Внимание

К настоящему времени эта функция еще не была документирована; для ознакомления доступен только список аргументов.

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

Список параметров

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

Возвращаемые значения

В случае успешной работы возвращает TRUE.

Примеры

Пример #1 ImagickDraw::composite()

<?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();
}

?>



Вернуться к: ImagickDraw

© 2024 «PHP.RU — Сообщество PHP-Программистов»
Главная | Форум | Реклама на сайте | Контакты VIP Сувениры
Разработка компании ODware