DANAK php的聊天頁面上有這個環節,它提供了一個積極的例子給我提供。 http://www.phpimagick.com/ImagickDraw/circle
的變量名是準確的描述, 和例子,很容易讓我明白了是怎麼回事。
function circle($strokeColor, $fillColor, $backgroundColor, $originX, $originY, $endX, $endY) {
//Create a ImagickDraw object to draw into.
$draw = new \ImagickDraw();
$strokeColor = new \ImagickPixel($strokeColor);
$fillColor = new \ImagickPixel($fillColor);
$draw->setStrokeOpacity(1);
$draw->setStrokeColor($strokeColor);
$draw->setFillColor($fillColor);
$draw->setStrokeWidth(2);
$draw->setFontSize(72);
$draw->circle($originX, $originY, $endX, $endY);
$imagick = new \Imagick();
$imagick->newImage(500, 500, $backgroundColor);
$imagick->setImageFormat("png");
$imagick->drawImage($draw);
header("Content-Type: image/png");
echo $imagick->getImageBlob();
}
來源
2014-09-08 12:32:52
j0h
http://www.phpimagick.com/ImagickDraw/circle – Danack 2014-09-07 14:18:43