-4

请问是否有任何 php 脚本可以将我的网站名称附加在图片上,这样当用户从我的网站下载任何图片或图像时,我的网站名称将被附加在那里,就像快门股票如何做他们的一样。请帮忙!谢谢!

4

1 回答 1

1

您应该使用 php水印功能。

中心定位水印

<?php
// Load the stamp and the photo to apply the watermark to
$stamp = imagecreatefrompng('stampimg.png');
$im = imagecreatefrompng('mainimage.png');

// Set the margins for the stamp and get the height/width of the stamp image
$marge_right = 10;
$marge_bottom = 10;
$sx = imagesx($stamp);
$sy = imagesy($stamp);

$imgx = imagesx($im);
$imgy = imagesy($im);
$centerX=round($imgx/2);
$centerY=round($imgy/2);

// Copy the stamp image onto our photo using the margin offsets and the photo 
// width to calculate positioning of the stamp. 
imagecopy($im, $stamp, $centerX, $centerY, 0, 0, imagesx($stamp), imagesy($stamp));

// Output and free memory
header('Content-type: image/png');
imagepng($im);
imagedestroy($im);
?>
于 2013-09-30T19:55:50.860 回答