Home > php教程 > php手册 > 通过gd库为图片添加透明水印

通过gd库为图片添加透明水印

WBOY
Release: 2016-06-13 10:32:16
Original
1118 people have browsed it

请查看源文件
注:需GD 2.0以上才能有透明效果
(做为现在的主流开发语言)
header ("Content-type: image/png");
$logoImage = ImageCreateFromPNG(test.png);
$photoImage = ImageCreateFromJpeg(back.jpg);
ImageAlphaBlending($photoImage, true);
$logoW = ImageSX($logoImage);
$logoH = ImageSY($logoImage);
ImageCopy($photoImage, $logoImage, 0, 0, 0, 0, $logoW, $logoH);
ImageJPEG($photoImage); // output to browser
ImageDestroy($photoImage);
ImageDestroy($logoImage);
?>

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template