Canvas — Resize the image canvas
Canvas is part of the Gallery package.
class Canvas implements Transform { private array $color private int $height private int $offset_x private int $offset_y private int $width public Canvas __construct ( int $width, int $height, int $offset_x, int $offset_y, array $color ); public resource apply ( resource $image, &$image ); }
Canvas
Resize the image canvas
private array $color
An array of three elements for the color in RGB
Default value: empty string
private int $height
The height of the new image canvas
Default value: empty string
private int $offset_x
The X offset of the original image
Default value: empty string
private int $offset_y
The Y offset of the original image
Default value: empty string
private int $width
The width of the new image canvas
Default value: empty string
public Canvas __construct ( int $width, int $height, int $offset_x, int $offset_y, array $color );
Create a new Canvas object
To center the image on the new canvas, pass NULL to the $offset_x and/or $offset_y. Offsets can also be negative.
public resource apply ( resource $image, &$image );
Put the image on the new canvas