我会尽力帮助您翻译。以下是内容的翻译:
当我合并这些图像时,png图像被放置在正确的位置,其上方和左侧的所有内容都很好(jpg被复制),但其他所有内容都是黑色的。
我尝试将imagesavealpha和imagealphablending设置为false,但没有任何区别。
您可以在http://ekstrakt.selfip.com/photobomb/image.php查看结果图像。
我在网上搜索过,但找不到解决方案。
感谢您的任何帮助。
看起来很简单,但并不是 :(
我正在尝试在图像(jpg)上添加类似于水印(透明png)的东西。这是我正在使用的代码:
$width = 800;
$height = 600;
$bottom_image = imagecreatefromjpeg("portrait1.jpg");
$top_image = imagecreatefrompng("man2.png");
imagesavealpha($top_image, true);
imagealphablending($top_image, true);
imagecopy($bottom_image, $top_image, 200, 200, 0, 0, $width, $height);
header('Content-type: image/png');
imagepng($bottom_image);
当我合并这些图像时,png图像被放置在正确的位置,其上方和左侧的所有内容都很好(jpg被复制),但其他所有内容都是黑色的。
我尝试将imagesavealpha和imagealphablending设置为false,但没有任何区别。
您可以在http://ekstrakt.selfip.com/photobomb/image.php查看结果图像。
我在网上搜索过,但找不到解决方案。
感谢您的任何帮助。