Php 在gd库中创建图像
我正在使用GD库在图像上复制图像,但它没有正确显示。这是我的代码:Php 在gd库中创建图像,php,ajax,Php,Ajax,我正在使用GD库在图像上复制图像,但它没有正确显示。这是我的代码: <?php $im = imagecreate(288,288); $background_color = imagecolorallocate($im, 230, 248, 248); $file = 'images/smiley/smile'.$_POST['smiley'].'.png'; $bg = imagecreatefrompng($file); imagealphablending($bg, true);
<?php
$im = imagecreate(288,288);
$background_color = imagecolorallocate($im, 230, 248, 248);
$file = 'images/smiley/smile'.$_POST['smiley'].'.png';
$bg = imagecreatefrompng($file);
imagealphablending($bg, true);
imagesavealpha($bg, true);
imagecopymerge($im, $bg, 10, 10, 0, 0, 100, 47, 25);
?>
我无法上传图像,因为声誉不够,但我可以解释,当我有一个笑脸时,我必须与其他图像重叠,但当我运行此功能时,图像上的灰色框会重叠,而不是笑脸。Smiley也是灰色的
请帮忙
这是函数运行后创建图像的链接
我想重叠这张图片
尝试为
$im
设置图像AlphaBlending
:
$im = imagecreate(288,288);
imagealphablending($im, true);
$background_color = imagecolorallocate($im, 230, 248, 248);
$file = 'images/smiley/smile'.$_POST['smiley'].'.png';
$bg = imagecreatefrompng($file);
imagealphablending($bg, true);
imagesavealpha($bg, true);
imagecopymerge($im, $bg, 10, 10, 0, 0, 100, 47, 25);
请发布一个链接到你的图片,比如说,有人会将其编辑到你的帖子中