Adobe ColdFusion 8

ImagePaste

Description

Takes two images and an (x,y) coordinate and draws the second image over the first image with the upper-left corner at coordinate (x,y).

Returns

A ColdFusion image.

Category

Image functions

Function syntax

ImagePaste(image1, image2, x, y)

See also

ImageCopy, ImageOverlay, ImageSetAntialiasing, IsImageFile

History

ColdFusion 8: Added this function.

Parameters

Parameter

Description

image1

Required. The bottom ColdFusion image.

Image2

Required. The ColdFusion image that is pasted on top of image1.

x

Required. The x coordinate where the upper-left corner of image2 is pasted.

y

Required. The y coordinate where the upper-left corner of image2 is pasted.

Usage

Use the ImageSetAntialiasing function to improve the quality of the rendered image.

Example

<!--- This example shows how to copy a small rectangular area of one image and paste it over a larger image. --->
<!--- Create a ColdFusion image from an existing JPEG file and name it "myImage1". --->
<cfimage source="../cfdocs/images/artgallery/jeff05.jpg" name="myImage1">
<!--- Create a ColdFusion image from an existing JPEG file and name it "myImage2". --->
<cfimage source="../cfdocs/images/artgallery/maxwell01.jpg" name="myImage2">
<!--- Copy a rectangular region of myImage1. --->
<cfset resImage = ImageCopy(myImage1,1,1,50,50)>
<!--- Paste the rectangular area over myImage2. --->
<cfset ImagePaste(myImage2,resImage,100,100)>
<!--- Write the second ColdFusion image to result.jpg. --->
<cfimage source="#myImage2#" action="write" destination="test_myImage.jpg" overwrite="yes">
<!--- Display the two source images and the new image. --->
<img src="../cfdocs/images/artgallery/jeff05.jpg"/>
<img src="../cfdocs/images/artgallery/maxwell01.jpg"/>
<img src="test_myImage.jpg"/>