Create an image from scratch
public create ( integer $width, integer | null $height = null, null | string $color = null ) | ||
$width | integer | Image width |
$height | integer | null | If omitted - assumed equal to $width |
$color | null | string | Hex color string, array(red, green, blue) or array(red, green, blue, alpha). Where red, green, blue - integers 0-255, alpha - integer 0-127 |
public function testCreateFromScratchFull() { $actual = Helper::getActual(__FUNCTION__ . '.png'); $excepted = Helper::getExpected(__FUNCTION__ . '.png'); $img = new Image(); $img->create(200, 100, array(0, 136, 204, 64))->saveAs($actual); Helper::isFileEq($actual, $excepted); }