• home
  • forum
  • my
  • kt
  • download
  • Using CFIMAGE to Watermark an Image

    Author: 2008-08-05 06:09:10 From:

    PDF   Flashpaper    
    1. 2 lines in which I basically give both images a name. The reason the watermark is a png is I want to have the ability to use alpha channels.
      <cfimage source="img_2566.jpg" name="image">
      <cfimage source="watermark.png" name="watermark">
    2. Next paste the watermark onto the image at 0x and 0y. I cheated and created the images the same size, but you could easily read the image info get the size then calculate where you want the watermark to be.
      <cfset ImagePaste(image, watermark, 0, 0)>
    3. The last line writes the image to the browser in the format of a jpeg.
      <cfimage source="#image#" action="writeToBrowser" format="jpg">
    4. The Final Code should look like this
      <cfimage source="img_2566.jpg" name="image">
      <cfimage source="watermark.png" name="watermark">
      <cfset ImagePaste(image, watermark, 0, 0)>
      <cfimage source="#image#" action="writeToBrowser" format="jpg">

    discuss this topic to forum

    relation tutorial

    No relevant information

    New

    Hot