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