php - draw multiple circles with imagemagick -
i trying draw multiple circles on background image, im having hard time figuring out how it.
ive tried passing multiple imagemagick instances draw function did not work.
so tried creating new image object, , setting transparent. tried drawing image on top of that, cant adjust opacity @ all.
along lines of trying this:
<?php ini_set('display_errors', 'on'); error_reporting(e_all | e_strict); function drawimage(imagick $im) { // $im->setcompressionquality(100); $im->setimageformat("jpg"); header("content-type: image/" . $im->getimageformat()); echo $im; exit; } // define circle mask $layer = new imagick('spc.jpg'); //now need height , width. $width = $layer->getimagewidth(); $height = $layer->getimageheight(); $x = $width/2; $y = $height/2; $endx = $x + 150; $endy = $y + 150; $circle = new imagickdraw(); $circle->setfillcolor("#ffff00"); $circle->circle($x, $y, $endx, $endy); //$layer->drawimage($circle, $circle2); $circle2 = new imagickdraw(); $circle2->setfillcolor("#0000ff"); $circle2->circle(0, 0, $x, $y); $layer->drawimage($circle, $circle2); drawimage($layer); ?>
drawimage shoud 1 parameter. try @ final lines:
$layer->drawimage($circle); $layer->drawimage($circle2); drawimage($layer);
Comments
Post a Comment