1--TEST-- 2Test ImagickDraw, circle 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$originX = 250; 12$originY = 250; 13$endX = 400; 14$endY = 400; 15 16function circle($strokeColor, $fillColor, $backgroundColor, $originX, $originY, $endX, $endY) { 17 18 //Create a ImagickDraw object to draw into. 19 $draw = new \ImagickDraw(); 20 21 $strokeColor = new \ImagickPixel($strokeColor); 22 $fillColor = new \ImagickPixel($fillColor); 23 24 $draw->setStrokeOpacity(1); 25 $draw->setStrokeColor($strokeColor); 26 $draw->setFillColor($fillColor); 27 28 $draw->setStrokeWidth(2); 29 $draw->setFontSize(72); 30 31 $draw->circle($originX, $originY, $endX, $endY); 32 33 $imagick = new \Imagick(); 34 $imagick->newImage(500, 500, $backgroundColor); 35 $imagick->setImageFormat("png"); 36 $imagick->drawImage($draw); 37 38 $bytes = $imagick->getImageBlob(); 39 if (strlen($bytes) <= 0) { echo "Failed to generate image.";} 40} 41 42circle($strokeColor, $fillColor, $backgroundColor, $originX, $originY, $endX, $endY) ; 43echo "Ok"; 44?> 45--EXPECTF-- 46Ok