【问题标题】:Black box around overlaying images (GD Library)覆盖图像周围的黑框(GD 库)
【发布时间】:2013-04-05 21:00:41
【问题描述】:

好的,所以我已经设法覆盖了两个保持透明度的图像,但是现在覆盖图像的右侧周围有一个巨大的黑框..它仍然是透明的,我只需要这个框消失..

这是我的代码..

<?php
header('Content-Type: image/png');

$master = imagecreatefrompng('Master.png');
$month = imagecreatefrompng('Mar.png');

imagealphablending($month,true);

imagealphablending($master,true);

imagecopy($master, $month, 83, 290, 0, 0, imagesx($master), imagesx($master));

imagepng($master, null, 1);

?>

我曾尝试使用 imagesavealpha() 但这也不起作用.. 有人有什么想法吗?

谢谢大家

【问题讨论】:

    标签: php html gd


    【解决方案1】:
    imagecopy($master, ..snip.. imagesx($master), imagesx($master));
                                        ^^^^^^^---should be $month
                                                        ^--- should be 'y'
                                                          ^^^^^^^--- also $month
    

    【讨论】:

    • 亲爱的,谢谢你的帮助!很惊讶我没有注意到它......但现在是早上 7 点,我整晚都没有喝咖啡! :P
    猜你喜欢
    • 2019-07-19
    • 1970-01-01
    • 1970-01-01
    • 2012-10-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多