[英]Watermark opacity fading
i've been trying to make some "watermark script ?" 我一直在尝试制作一些“水印脚本”? I am french learning english so i don't even know if watermark mean something...
我正在法国学习英语,所以我什至不知道水印是什么意思。
i use this as watermark 我用它作为水印
and here is the result 这是结果
The original img is the same 原始的img是一样的
Finally the code 最后的代码
$uploaded_img = imagecreatefrompng($nom_fichier_temp); // the background, get by a form
$img_taille["x"] = imagesx($uploaded_img);
$img_taille["y"] = imagesy($uploaded_img);
$nbr_en_x = ceil($img_taille["x"]/300);
$nbr_en_y = ceil($img_taille["y"]/300);
$Cc = imagecreatefrompng("img/Cc.png"); //Watermark 300x300
$fond_rouge = imagecolorallocate($Cc, 255, 0, 0);
imagecolortransparent($Cc, $fond_rouge); // Deleting the red BG
for ($j=0; $j < $nbr_en_y; $j++) {
$y = floor($j*300);
for ($i=0; $i < $nbr_en_x; $i++) {
imagecopymerge($uploaded_img, $Cc, $i*300, $y, 0, 0, $img_taille["x"], $img_taille["y"], 10);
}
}
imagepng($uploaded_img, '../'. $destination);
Hope it's clear enough and wish you find where i failed :s 希望它足够清楚,希望您找到我失败的地方:
Thanks :D 感谢:D
So dumb 如此愚蠢
imagecopymerge($uploaded_img, $Cc, $i*300, $y, 0, 0, 300, 300, 10);
I'll never try to code late again... 我再也不会尝试编码了……
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.