<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="ja"
xml:lang="ja" dir="ltr">
<head>
<title>sample1113(ImageMagick6.5.2)</title>
</head>
<body>
<?php
$im = new Imagick();
$im->newImage(200,200,"none");
$idraw = new ImagickDraw();
$idraw->setFillColor("none");
$idraw->setStrokeColor("#99bbff");
$idraw->setStrokeWidth(20);
/* ラインキャップの種類を指定 */
$idraw->setStrokeLineCap(Imagick::LINECAP_ROUND);
/* ラインジョインの種類を指定 */
$idraw->setStrokeLineJoin(Imagick::LINEJOIN_ROUND);
$points[] = array('x' => 20, 'y' => 180);
$points[] = array('x' => 100, 'y' => 20);
$points[] = array('x' => 180, 'y' => 180);
$idraw->polyline($points);
$im->drawImage($idraw);
$im->writeImage('sample1113a.png');
$idraw->destroy();
$im->destroy();
?>
<img src="sample1113a.png" /><br />
</body>
</html>
出力画像(sample1113a.png)
![Imagickでラインキャップ・ラインジョインを設定した画像](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiu9K6iL92BSUraYOff-QHLmqZX81Das3y06tQAHsFwCtZdXxqrW5-j8Sqhe01uvh99dAZHH3BFqWp6zTp-M2slNVF7SxkckPsvxkv1wKSGIpj6BAFh1qS1kWZ1G69FQsPoFhr2iA/s320/sample1113a.png)
No comments:
Post a Comment