-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.php
32 lines (24 loc) · 830 Bytes
/
example.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
// Direct
//require __DIR__ .'/src/ImagickTextBox.php';
// Composer
require __DIR__ .'/vendor/autoload.php';
use ImagickTextBox\ImagickTextBox;
$image = new Imagick();
$image->newImage(800, 400, 'gray');
$image->setImageFormat('jpg');
// TextBox at north west corner
$textBoxNW = new ImagickTextBox($image);
$textBoxNW->string ='composer require christianberkman/imagick-text-box';
$textBoxNW->box->setFillCOlor('navy blue');
$textBoxNW->text->setFillColor('white');
$textBoxNW->draw(Imagick::GRAVITY_NORTHWEST);
// Text box at south east corner
$textBoxSE = new ImagickTextBox($image);
$textBoxSE->string = 'use ImagickTextBox\ImagickTextBox;';
$textBoxSE->text->setFillColor('navy blue');
$textBoxSE->draw(Imagick::GRAVITY_SOUTHEAST);
header('Content-Type: image/jpeg');
echo $image;
return;
?>