<?php
$imagick
=
new
Imagick();
$imagick
->newImage(800, 250,
'white'
);
$draw
=
new
ImagickDraw();
$draw
->setStrokeColor(
'blue'
);
$draw
->setFillColor(
'cyan'
);
$draw
->setStrokeWidth(2);
$draw
->pushClipPath(
'testClipPath'
);
$draw
->rectangle(0, 0, 300, 300);
$draw
->popClipPath();
$draw
->setClipPath(
'testClipPath'
);
$draw
->circle(150, 50, 300, 150);
$imagick
->drawImage(
$draw
);
$imagick
->setImageFormat(
'png'
);
header(
"Content-Type: image/png"
);
echo
$imagick
->getImageBlob();
?>