使用php代码合并PNG背景上的用户图像。以下是我使用的代码。如何在php中的背景PNG图像合并图像
$width = 140;
$height = 140;
$bottom_image = imagecreatefrompng("bg.png");
$top_image = imagecreatefromjpeg("default.jpg");
imagesavealpha($top_image, true);
imagealphablending($top_image, false);
imagecopyresampled($bottom_image, $top_image, 290, 125, 0, 0, $width, $height, $width, $height);
//imagecopy($bottom_image, $top_image, 290, 125, 0, 0, $width, $height);
header('Content-type: image/png');
imagepng($bottom_image);
but i got this result when i save image
我想在圆圈用户图像回来。
http://stackoverflow.com/questions/999251/crop-or-mask-an-image-into-a-circle/999563#999563 – C2486