Water mark Effect : Water Mark « Graphics Image « PHP






Water mark Effect

<?php
$myImage = imagecreatefromgif('largeJava2sLogo.GIF');
$myCopyright = imagecreatefrompng('logo.png');


$destWidth = imagesx($myImage);
$destHeight = imagesy($myImage);
$srcWidth = imagesx($myCopyright);
$srcHeight = imagesy($myCopyright);

$destX = ($destWidth - $srcWidth) / 2;
$destY = ($destHeight - $srcHeight) / 2;
$white = imagecolorexact($myCopyright, 255, 255, 255);
imagecolortransparent($myCopyright, $white);

imagecopymerge($myImage, $myCopyright, $destX, $destY, 0, 0, $srcWidth, $srcHeight, 50);


header("Content-type: image/jpeg");
imagejpeg($myImage);
imagedestroy($myImage);
imagedestroy($myCopyright);
?>

           
       








Related examples in the same category