1--TEST-- 2Test ImagickDraw, polyline 3--SKIPIF-- 4<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> 5--FILE-- 6<?php 7 8$backgroundColor = 'rgb(225, 225, 225)'; 9$strokeColor = 'rgb(0, 0, 0)'; 10$fillColor = 'DodgerBlue2'; 11 12function polyline($strokeColor, $fillColor, $backgroundColor) { 13 $draw = new \ImagickDraw(); 14 15 $draw->setStrokeOpacity(1); 16 $draw->setStrokeColor($strokeColor); 17 $draw->setFillColor($fillColor); 18 19 $draw->setStrokeWidth(5); 20 21 $points = array( 22 array('x' => 40 * 5, 'y' => 10 * 5), 23 array('x' => 20 * 5, 'y' => 20 * 5), 24 array('x' => 70 * 5, 'y' => 50 * 5), 25 array('x' => 60 * 5, 'y' => 15 * 5) 26 ); 27 28 $draw->polyline($points); 29 30 $image = new \Imagick(); 31 $image->newImage(500, 300, $backgroundColor); 32 $image->setImageFormat("png"); 33 $image->drawImage($draw); 34 35 $bytes = $image->getImageBlob(); 36 if (strlen($bytes) <= 0) { echo "Failed to generate image.";} 37} 38 39polyline($strokeColor, $fillColor, $backgroundColor) ; 40echo "Ok"; 41?> 42--EXPECTF-- 43Ok