Return an image containing the affine transformed src image, using an optional clipping area
Syntax
imageaffine( GdImage $image, array $affine, ?array $clip = null ): GdImage|false
Parameters
image
A GdImage object, returned by one of the image creation functions, such as imagecreatetruecolor().
affine
Array with keys 0 to 5.
clip
Array with keys "x", "y", "width" and "height"; or null.
Return
Return affined image object on success or false on failure.
Examples
1 · image affine
<? $width = 100; $height = 100; $image = imagecreate($width, $height); $affine = array(1, 0, 0, 1, 0, 0); $return = imageaffine($image, $affine); var_dump($return); ?>
object(GdImage)#2 (0) { }
2 · clip
<? $width = 100; $height = 100; $image = imagecreate($width, $height); $affine = array(1, 0, 0, 1, 0, 0); $clip = array('x' => 0, 'y' => 0, 'width' => $width, 'height' => $height); $return = imageaffine($image, $affine, $clip); var_dump($return); ?>
object(GdImage)#2 (0) { }