1--TEST-- 2Test ImagickDraw, setStrokeOpacity 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 setStrokeOpacity($strokeColor, $fillColor, $backgroundColor) { 13 $draw = new \ImagickDraw(); 14 15 $draw->setStrokeWidth(1); 16 $draw->setStrokeColor($strokeColor); 17 $draw->setFillColor($fillColor); 18 $draw->setStrokeWidth(10); 19 $draw->setStrokeOpacity(1); 20 $draw->line(100, 80, 400, 125); 21 $draw->rectangle(25, 200, 150, 350); 22 $draw->setStrokeOpacity(0.5); 23 $draw->line(100, 100, 400, 145); 24 $draw->rectangle(200, 200, 325, 350); 25 $draw->setStrokeOpacity(0.2); 26 $draw->line(100, 120, 400, 165); 27 $draw->rectangle(375, 200, 500, 350); 28 29 $image = new \Imagick(); 30 $image->newImage(550, 400, $backgroundColor); 31 $image->setImageFormat("png"); 32 $image->drawImage($draw); 33 34 $bytes = $image->getImageBlob(); 35 if (strlen($bytes) <= 0) { echo "Failed to generate image.";} 36} 37 38setStrokeOpacity($strokeColor, $fillColor, $backgroundColor) ; 39echo "Ok"; 40?> 41--EXPECTF-- 42Ok