Rotates a ColdFusion image at a specified point by a specified angle.
Nothing.
ImageRotate(name,angle[,x,y,interpolation])
cfimage, ImageFlip, ImageSetAntialiasing, IsImageFile
ColdFusion 8: Added this function.
|
Parameter |
Description |
|---|---|
| name |
Required. The ColdFusion image on which this operation is performed. |
| angle |
Required. The rotation angle in degrees. |
| x |
Optional. The x coordinate for the point of rotation. The default value is 2. |
| y |
Optional. The y coordinate for the point of rotation. The default value is 2. |
| interpolation |
Optional. Type of interpolation:
|
You must specify both the x and the y coordinates or neither. If you do not specify the x and y coordinates, the point of rotation is the center of the image, which is the default position. Use the ImageSetAntialiasing function to improve the quality of the rendered image.
Example 1
<!--- This example shows how to rotate an image by 10 degrees. --->
<!--- Create a ColdFusion image from an existing JPEG file. --->
<cfset myImage=ImageNew("../cfdocs/images/artgallery/jeff05.jpg")>
<cfset ImageSetAntialiasing(myImage,"on")>
<!--- Rotate the image by 10 degrees. --->
<cfset ImageRotate(myImage,10)>
<cfimage source="#myImage#" action="writeToBrowser">
Example 2
<!--- This example shows how to rotate an image by 10 degrees and change the interpolation to bicubic for higher resolution. The image is rotated at the (10,90) coordinates. ---> <cfimage source="../cfdocs/images/artgallery/jeff05.jpg" name="myImage"> <cfset ImageRotate(myImage,10,10,90,"bicubic")> <cfimage source="#myImage#" destination="testMyImage.jpeg" action="write" overwrite="yes"> <img src="../cfdocs/images/artgallery/jeff05.jpg"> <img src="testMyImage.jpeg">