imageFlip

Flips an image across an axis.

imageFlip(name, transpose) → returns void

Member Function Syntax

someImage.flip(transpose)

imageFlip Argument Reference

name string
Required

The image on which this operation is performed.

transpose string
Required
Default: vertical

Transpose the image.

vertical: 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.
Or rotate an image clockwise by 90, 180, or 270 degrees.
Values:
  • vertical
  • horizontal
  • diagonal
  • antidiagonal
  • 90
  • 180
  • 270

Examples sample code invoking the imageFlip function

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"> 

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