这个 Imagick::rotateImage() 函数是PHP中的一个内置函数,用于按给定角度旋转图像,并用给定颜色填充空白。
null
语法:
bool Imagick::rotateImage( $background, $degrees )
参数: 该函数接受两个参数,如下所述:
- $background: 此参数用于设置图像的背景色。这种类型的数据类型可以是string,也可以是float。
- $degrees: 此参数用于设置图像旋转的角度。旋转角度被解释为顺时针。
返回值: 此函数在成功时返回True。
下面的程序举例说明 Imagick::rotateImage() PHP中的函数: 原始图像:
节目:
<?php // require_once('path/vendor/autoload.php'); // Create a new imagick object $image = new Imagick( // Function to rotate an Image $image ->rotateimage( 'green' , 25); header( "Content-Type: image/jpg" ); // Display the output echo $image ->getImageBlob(); ?> |
输出:
相关文章:
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END