Navigation :

Home
Source code
Tutorials
RSS feeds
Articles
Wordpress plugins
Blog
Books
Software
Downloads
Hosting
manuals
Script directory
Training
Our Links




Site Sponsors :

Bookmark :

Links :

software directory
dropshippers
gambling sites

Downloads :

Misc :

Webmaster Resources
Only PHP
ScriptSearch.com
Scripts.com - Get the best scripts NOW!
AndreaPHP Programming

Valid XHTML 1.0 Transitional


Valid CSS!




watermark an image example

watermark an image example

Using this on our iwantfreebies site

<?php

header('content-type: image/jpeg'); //content type is a jpeg

$watermark = imagecreatefrompng('watermark.jpg'); //this is the watermark we are using
//gets the dimensions of the watermark image
$width = imagesx($watermark);
$height = imagesy($watermark);
$image = imagecreatetruecolor($width, $height);
//image to be watermarked
$image = imagecreatefromjpeg("sampleimage.jpg");
//get the size of the image
$size = getimagesize("sampleimage.jpg");
$dest_x = $size[0] - $width - 5;
$dest_y = $size[1] - $height - 5;
//copy watermark on to image
imagecopymerge($image, $watermark, $dest_x, $dest_y, 0, 0, $width, $height, 100);
imagejpeg($image);
//important to clean up
imagedestroy($image);
imagedestroy($watermark);

?>