Answer the question
In order to leave comments, you need to log in
How to make Imagick, ImagickDraw, etc. work. in Laravel?
Hello!
Can you please tell me how to work with these classes in Laravel?
use Imagick etc. Does not help. All the same writes that such class is not found.
Piece of code:
$draw = new ImagickDraw();
$strokeColor = new ImagickPixel('rgb(0, 0, 0)');
$fillColor = new ImagickPixel('DodgerBlue2');
$draw->setStrokeOpacity(1);
$draw->setStrokeColor($strokeColor);
$draw->setFillColor($fillColor);
$draw->setStrokeWidth(2);
$draw->setFontSize(72);
$draw->circle(50, 50, 100, 100);
$imagick = new Imagick();
$imagick->newImage(500, 500, new ImagickPixel('transparent'));
$imagick->setImageFormat("png");
$imagick->drawImage($draw);
header("Content-Type: image/png");
echo $imagick->getImageBlob();
use Imagick;
use ImagickDraw;
use ImagickPixel;
Answer the question
In order to leave comments, you need to log in
apt-get install php5-gd
This should be installed separately from pecl.
php.net/manual/en/imagick.installation.php
use Imagick;
use ImagickDraw;
use ImagickPixel;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question