1--TEST-- 2Test ImagickDraw, arc 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$startX = 50; 12$startY = 50; 13$endX = 400; 14$endY = 400; 15$startAngle = 0; 16$endAngle = 270; 17 18function arc($strokeColor, $fillColor, $backgroundColor, $startX, $startY, $endX, $endY, $startAngle, $endAngle) { 19 20 //Create a ImagickDraw object to draw into. 21 $draw = new \ImagickDraw(); 22 $draw->setStrokeWidth(1); 23 $draw->setStrokeColor($strokeColor); 24 $draw->setFillColor($fillColor); 25 $draw->setStrokeWidth(2); 26 27 $draw->arc($startX, $startY, $endX, $endY, $startAngle, $endAngle); 28 29 //Create an image object which the draw commands can be rendered into 30 $image = new \Imagick(); 31 $image->newImage(500, 500, $backgroundColor); 32 $image->setImageFormat("png"); 33 34 //Render the draw commands in the ImagickDraw object 35 //into the image. 36 $image->drawImage($draw); 37 38 //Send the image to the browser 39 $bytes = $image->getImageBlob(); 40 if (strlen($bytes) <= 0) { echo "Failed to generate image.";} 41} 42 43arc($strokeColor, $fillColor, $backgroundColor, $startX, $startY, $endX, $endY, $startAngle, $endAngle) ; 44echo "Ok"; 45?> 46--EXPECTF-- 47Ok