Important notice: the development of WideImage 1.0 branch is discontinued.
Please visit
http://wideimage.sourceforge.net for the new version of library and documentation.
This web site will remain accessible to serve as documentation for the old versions of the library.
For help on migration, please refer
to the
migration
guide.
wiImage::rotate()
See:
List of operations
Signature
wiImage::rotate($angle, $bgColor = null, $ignoreTransparent = true)
Parameters
- $angle (int): angle to rotate. In degrees, clockwise.
- $bgColor (int): index of the color that will fill the empty space. Leave null to auto-detect or allocate a transparent color.
- $ignoreTransparent (bool): set to true to ignore transparent colors.
- result (wiTrueColorImage): rotated image
Description
This method will rotate an image with a given angle using
imagerotate()∞.
If you set $bgColor to null, a transparent color will be detected. If the image is not transparent, fully transparent alpha-color will be allocated with
allocateColorAlpha()∞. If you save such an image to a format that doesn't support transparency (like jpeg), the background color will be undefined.
Notes
- Currently, there seems to be a bug with (alpha)transparent images rotated for more than 45 and less than 315 degress. This bug seems to be reported and fixed in CVS∞ in Nov 2006, but I still have this issue on PHP 5.2.
Examples
$img = wiImage::load('/path/to/an/image.png');
// rotate and save
$img->rotate(45)->save('rotated.png');
CategoryDocApi
There are no comments on this page. [Add comment]