Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/231.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 在gd库中创建图像_Php_Ajax - Fatal编程技术网

Php 在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);

我正在使用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); 
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);

请发布一个链接到你的图片,比如说,有人会将其编辑到你的帖子中