<?php
header('content-type:image/png');
$img = imagecreatefrompng('su.png');
$waterMark = imagecreatefrompng('susu.png');
$color = imagecolorallocate($img,225,65,75);
$color2 = imagecolorallocate($img,85,125,25);
$width = imagesx($img);
$height = imagesy($img);
$waterMarkWidth = imagesx($waterMark);
$waterMarkHeight = imagesy($waterMark);
$position = imagettfbbox(24,0,'zw.ttf','汪苏泷love');
$stringWidth = $position[2] - $position[0];
//文字水印
imagettftext($img,24,0,$width-1-$stringWidth-10,$height-1-10,$color,'zw.ttf','汪苏泷love');
imagettftext($img,28,0,300,200,$color2,'zw.ttf','happy');
//图片水印
//imagecopy($img,$waterMark,20,600,0,0,$waterMarkWidth,$waterMarkHeight);
//图片水印-透明度
imagecopymerge($img,$waterMark,20,600,0,0,$waterMarkWidth,$waterMarkHeight,30);
imagepng($img);
imagedestroy($img);
?>