imageFlip

Flips an image across an axis.

imageFlip(name, transpose) → returns void

Member Function Syntax

someImage.flip(transpose)

Argument Reference for the imageFlip function

name

Required: Yes
The image on which this operation is performed.

transpose

Required: Yes
Default: vertical
Transpose the image. Values:
  • vertical (default): Flip an image across an imaginary horizontal line that runs through the center of the image.
  • horizontal: Flip an image across an imaginary vertical line that runs through the center of the image.
  • diagonal: Flip an image across its main diagonal that runs from the upper-left to the lower-right corner.
  • antidiagonal: Flip an image across its main diagonal that runs from the upper-right to the lower-left corner.
  • 90|180|270: Rotate an image clockwise by 90, 180, or 270 degrees.

Examples sample code invoking the imageFlip function


Tag Syntax

This example shows how to rotate an image by 270 degrees.

<!--- Create a ColdFusion image from an existing JPEG file. ---> 
 <cfimage source="../cfdocs/images/artgallery/paul03.jpg" name="myImage"> 
 <!--- Turn on antialiasing to improve image quality. ---> 
 <cfset imageSetAntialiasing(myImage,"on")> 
 <!--- Rotate the image by 270 degrees. ---> 
 <cfset imageFlip(myImage,"270")> 
 <!--- Display the modified image in a browser. ---> 
 <cfimage source="#myImage#" action="writeToBrowser"> 

Using flip member function

CF 11+ Lucee 4.5+ Flip the image vertically

imgObj = imageRead("http://cfdocs.org/apple-touch-icon.png");
imgObj.flip("vertical");
cfimage (action="writeToBrowser", source=imgObj);

Fork me on GitHub