以下是指向http://www.true-gamerz.net/test2.php
页面的链接如果您查看图像,等级图像是透明的,但它不会在屏幕上显示 任何人都知道为什么会发生这种情况?
这是代码
<?
header('content-type: image/png');
$watermark = imagecreatefrompng('images/ranks/ranks_18.png');
$watermark_width = imagesx($watermark);
$watermark_height = imagesy($watermark);
$image = imagecreatetruecolor($watermark_width, $watermark_height);
$image = imagecreatefrompng("images/card/test.png");
$size = getimagesize("images/card/test.png");
$dest_x = $watermark_width;
$dest_y = $watermark_height;
imagecopymerge($image, $watermark, 289, 4, 0, 0, $watermark_width, $watermark_height, 100);
imagepng($image);
imagedestroy($image);
imagedestroy($watermark);
?>
答案 0 :(得分:2)
imagecopymerge不支持Alpha通道
阅读本文以获得解决方法:
http://www.php.net/manual/en/function.imagecopymerge.php#92787