Contact Us

Alagad is located in Chapel Hill, North Carolina in the Research Triangle Park area.

Phone: 888-ALAGAD4
Fax: 888-248-7836
Email: please use our contact form

208 Calderon Dr.
Chapel Hill, NC 27516 USA

Request an Alagad proposal
Request a TaskForce consultation

Draw Images Into Other Images

The following example draws a company logo into the upper left corner of an image.  The logo has an alpha channel which is used to composite the two images so that the image shows through the transparent portions of the logo.  Additionally, the logo is made to be slightly transparent.

Source Code

<!--- create the object --->
<cfset myImage = CreateObject("Component","Image") />

<!--- open a new image --->
<cfset myImage.readImage("d:examples\wineRose.jpg") />

<!--- set the transparency used when drawing into the image --->
<cfset myImage.setTransparency(25) />

<!--- draw an image into the image --->
<cfset myImage.drawImage("d:examples\logo.png", 20, 20) />

<!--- output the new image --->
<cfset myImage.writeImage("d:examples\wineRoseLogo.jpg", "jpg") />

<!--- output the images --->
<b>Result</b><br>
<img src="/examples/wineRoseLogo.jpg">

Results

AIC Example - Draw Images Into Other Images