|
ColdFusion 9.0 Resources |
ImageWriteParameters
UsageUse the following syntax to specify an in-memory file, which is not written to disk. In-memory files speed processing of transient data. ram:///filepath The filepath can include directories, for example ram:///petStore/images/poodle.jpg. Create the directories in the path before you specify the file. For more information on using in-memory files, see Optimizing transient files in the Developing ColdFusion Applications. The file format is derived from the file extension, therefore, use this function to convert images. For a list of valid formats to write, see the supported image file formats listed in cfimage. To retrieve a list of writable formats on the server where the ColdFusion application is deployed, use the GetWriteableImageFormats function. Note: Converting images between one file format to another
is time-consuming. Also, image quality can degrade; for example,
PNG images support 24-bit color, but GIF images support only 256
colors. Converting transparent images (images with alpha) can degrade
image quality.
Example<!--- This example shows how to convert a GIF image to a PNG image. --->
<!--- Use the ImageNew function to create a ColdFusion image. --->
<cfset myImage = ImageNew("http://www.google.com/images/logo_sm.gif")>
<!--- Convert the image to a PNG format. --->
<cfset ImageWrite(myImage,"google.png")>
<!--- Display the PNG image. --->
<img src="google.png">
|