ok
Direktori : /opt/cpanel/ea-php56/root/usr/share/tests/pecl/imagick/tests/ |
Current File : //opt/cpanel/ea-php56/root/usr/share/tests/pecl/imagick/tests/194_ImagickDraw_rectangle_basic.phpt |
--TEST-- Test ImagickDraw, rectangle --SKIPIF-- <?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> --FILE-- <?php $backgroundColor = 'rgb(225, 225, 225)'; $strokeColor = 'rgb(0, 0, 0)'; $fillColor = 'DodgerBlue2'; function rectangle($strokeColor, $fillColor, $backgroundColor) { $draw = new \ImagickDraw(); $strokeColor = new \ImagickPixel($strokeColor); $fillColor = new \ImagickPixel($fillColor); $draw->setStrokeColor($strokeColor); $draw->setFillColor($fillColor); $draw->setStrokeOpacity(1); $draw->setStrokeWidth(2); $draw->rectangle(200, 200, 300, 300); $imagick = new \Imagick(); $imagick->newImage(500, 500, $backgroundColor); $imagick->setImageFormat("png"); $imagick->drawImage($draw); $bytes = $imagick->getImageBlob(); if (strlen($bytes) <= 0) { echo "Failed to generate image.";} } rectangle($strokeColor, $fillColor, $backgroundColor) ; echo "Ok"; ?> --EXPECTF-- Ok