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