首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

Imagick::rotateImage

(PECL imagick 2.0.0)

Imagick::rotateImage — Rotates an image

Description

代码语言:javascript
复制
bool Imagick::rotateImage ( mixed $background , float $degrees )

Rotates an image the specified number of degrees. Empty triangles left over from rotating the image are filled with the background color.

Parameters

background

The background color

degrees

Rotation angle, in degrees. The rotation angle is interpreted as the number of degrees to rotate the image clockwise.

Return Values

Returns TRUE on success.

Changelog

Version

Description

2.1.0

Now allows a string representing the color as the first parameter. Previous versions allow only an ImagickPixel object.

Examples

Example #1 Imagick::rotateImage()

代码语言:javascript
复制
<?php
function?rotateImage($imagePath,?$angle,?$color)?{
????$imagick?=?new?\Imagick(realpath($imagePath));
????$imagick->rotateimage($color,?$angle);
????header("Content-Type:?image/jpg");
????echo?$imagick->getImageBlob();
}

?>

← Imagick::rollImage

Imagick::rotationalBlurImage →

代码语言:txt
复制
 ? 1997–2017 The PHP Documentation Group

Licensed under the Creative Commons Attribution License v3.0 or later.

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com