Learning ColdFusion 8: CFImage Part III - Watermarks And Transparency

<!--- Read in the original image. --->
<cfset objImage = ImageRead( "./blue_eyes.jpg" ) />
 
<!--- Read in the Kinky Solutions watermark. --->
<cfset objWatermark = ImageNew(
	"./kinky_solutions_watermark_png32.png"
	) />
 
 
<!---
	Turn on antialiasing on the existing image
	for the pasting to render nicely.
--->
<cfset ImageSetAntialiasing(
	objImage,
	"on"
	) />
 
<!---
	When we paste the watermark onto the photo, we don't
	want it to be fully visible. Therefore, let's set the
	drawing transparency to 50% before we paste.
--->
<cfset ImageSetDrawingTransparency(
	objImage,
	50
	) />
 
<!---
	Paste the watermark on to the image. We are going
	to paste this into the bottom, right corner.
--->
<cfset ImagePaste(
	objImage,
	objWatermark,
	(objImage.GetWidth() - objWatermark.GetWidth()),
	(objImage.GetHeight() - objWatermark.GetHeight())
	) />
 
 
<!--- Write it to the browser. --->
<cfimage
	action="writetobrowser"
	source="#objImage#"
	/>

For Cut-and-Paste