imageaffinematrixget
Description
The imageaffinematrixget of Image for PHP get an affine transformation matrix.
Syntax
imageaffinematrixget( int $type, array|float $options ): array|false
Parameters
type
One of the IMG_AFFINE_* constants.
options
If type is IMG_AFFINE_TRANSLATE or IMG_AFFINE_SCALE, options has to be an array with keys x and y, both having float values.
If type is IMG_AFFINE_ROTATE, IMG_AFFINE_SHEAR_HORIZONTAL or IMG_AFFINE_SHEAR_VERTICAL, options has to be a float specifying the angle.
Return
An affine transformation matrix (an array with keys 0 to 5 and float values) or false on failure.
Examples
1 · type options · IMG_AFFINE_TRANSLATE
<? $type = IMG_AFFINE_TRANSLATE; $options = array('x' => 2, 'y' => 3); $return = imageaffinematrixget($type, $options); print_r($return);
Array ( [0] => 1 [1] => 0 [2] => 0 [3] => 1 [4] => 2 [5] => 3 )
2 · type options · IMG_AFFINE_SCALE
<? $type = IMG_AFFINE_SCALE; $options = array('x' => 2, 'y' => 3); $return = imageaffinematrixget($type, $options); print_r($return);
Array ( [0] => 2 [1] => 0 [2] => 0 [3] => 3 [4] => 0 [5] => 0 )
3 · type options · IMG_AFFINE_ROTATE
<? $type = IMG_AFFINE_ROTATE; $options = 90.0; $return = imageaffinematrixget($type, $options); print_r($return);
Array ( [0] => 6.1232339957368E-17 [1] => 1 [2] => -1 [3] => 6.1232339957368E-17 [4] => 0 [5] => 0 )
4 · type options · IMG_AFFINE_SHEAR_HORIZONTAL
<? $type = IMG_AFFINE_SHEAR_HORIZONTAL; $options = 90.0; $return = imageaffinematrixget($type, $options); print_r($return);
Array ( [0] => 1 [1] => 0 [2] => 1.6331239353195E+16 [3] => 1 [4] => 0 [5] => 0 )
5 · type options · IMG_AFFINE_SHEAR_VERTICAL
<? $type = IMG_AFFINE_SHEAR_VERTICAL; $options = 90.0; $return = imageaffinematrixget($type, $options); print_r($return);
Array ( [0] => 1 [1] => 1.6331239353195E+16 [2] => 0 [3] => 1 [4] => 0 [5] => 0 )
Links
Image
- gd_info
- getimagesize
- getimagesizefromstring
- image_type_to_extension
- image_type_to_mime_type
- imageaffine
- imageaffinematrixconcat
- imagealphablending
- imageantialias
- imagearc
- imageavif
- imagebmp
- imagechar
- imagecharup
- imagecolorallocate
- imagecolorallocatealpha
- imagecolorat
- imagecolorclosest
- imagecolorclosestalpha
- imagecolorclosesthwb
- imagecolordeallocate
- imagecolorexact
- imagecolorexactalpha
- imagecolormatch
- imagecolorresolve
- imagecolorresolvealpha
- imagecolorset
- imagecolorsforindex
- imagecolorstotal
- imagecolortransparent
- imageconvolution
- imagecopy
- imagecopymerge
- imagecopymergegray
- imagecopyresampled
- imagecopyresized
- imagecreate
- imagecreatefromavif
- imagecreatefrombmp
- imagecreatefromgif
- imagecreatefromjpeg
- imagecreatefrompng
- imagecreatefromstring
- imagecreatefromtga
- imagecreatefromwbmp
- imagecreatefromwebp
- imagecreatefromxbm
- imagecreatefromxpm
- imagecreatetruecolor
- imagecrop
- imagecropauto
- imagedashedline
- imagedestroy
- imageellipse
- imagefill
- imagefilledarc
- imagefilledellipse
- imagefilledpolygon
- imagefilledrectangle
- imagefilltoborder
- imagefilter
- imageflip
- imagefontheight
- imagefontwidth
- imageftbbox
- imagefttext
- imagegammacorrect
- imagegetclip
- imagegetinterpolation
- imagegif
- imageinterlace
- imageistruecolor
- imagejpeg
- imagelayereffect
- imageline
- imageloadfont
- imageopenpolygon
- imagepalettecopy
- imagepalettetotruecolor
- imagepng
- imagepolygon
- imagerectangle
- imageresolution
- imagerotate
- imagesavealpha
- imagescale
- imagesetbrush
- imagesetclip
- imagesetinterpolation
- imagesetpixel
- imagesetstyle
- imagesetthickness
- imagesettile
- imagestring
- imagestringup
- imagesx
- imagesy
- imagetruecolortopalette
- imagettfbbox
- imagettftext
- imagetypes
- imagewbmp
- imagewebp
- imagexbm
- iptcembed
- iptcparse