1--TEST--
2Test ImagickDraw, skewX
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$fillModifiedColor = 'LightCoral';
12$startX = 50;
13$startY = 50;
14$endX = 400;
15$endY = 400;
16$skew = 10;
17
18function skewX($strokeColor, $fillColor, $backgroundColor, $fillModifiedColor,
19               $startX, $startY, $endX, $endY, $skew) {
20
21    $draw = new \ImagickDraw();
22
23    $draw->setStrokeColor($strokeColor);
24    $draw->setStrokeWidth(2);
25    $draw->setFillColor($fillColor);
26    $draw->rectangle($startX, $startY, $endX, $endY);
27    $draw->setFillColor($fillModifiedColor);
28    $draw->skewX($skew);
29    $draw->rectangle($startX, $startY, $endX, $endY);
30
31    $image = new \Imagick();
32    $image->newImage(500, 500, $backgroundColor);
33    $image->setImageFormat("png");
34
35    $image->drawImage($draw);
36
37    $bytes = $image->getImageBlob();
38    if (strlen($bytes) <= 0) { echo "Failed to generate image.";}
39}
40
41skewX($strokeColor, $fillColor, $backgroundColor, $fillModifiedColor,
42    $startX, $startY, $endX, $endY, $skew);
43echo "Ok";
44?>
45--EXPECTF--
46Ok