I have a function to splice two pictures. Here is my code
<code> $im = imagecreatefrompng("images/err.png"); $stamp = imagecreatefrompng('images/default.png'); $test = imagecreate(imagesx($stamp)+imagesx($im),imagesy($im)); $orange = imagecolorallocate($test, 255, 255, 255); // image imagecopy($test, $stamp, 0, 0, 0, 0, imagesx($stamp), imagesy($stamp)); imagecopy($test, $im, imagesx($stamp), 0, 10, 0, imagesx($im), imagesy($im)); header("Content-type: image/png"); imagepng($test); 最终的结果是 第二个拼接的图片的颜色都会跟着第一个变化 因为传不上图片只能文字描述下面假如AB是拼接好的图片 有A和B拼接成 B的颜色本来是红色但是拼接完成之后B的颜色会变成A的颜色 </code>
AB
I have a function to splice two pictures. Here is my code
<code> $im = imagecreatefrompng("images/err.png"); $stamp = imagecreatefrompng('images/default.png'); $test = imagecreate(imagesx($stamp)+imagesx($im),imagesy($im)); $orange = imagecolorallocate($test, 255, 255, 255); // image imagecopy($test, $stamp, 0, 0, 0, 0, imagesx($stamp), imagesy($stamp)); imagecopy($test, $im, imagesx($stamp), 0, 10, 0, imagesx($im), imagesy($im)); header("Content-type: image/png"); imagepng($test); 最终的结果是 第二个拼接的图片的颜色都会跟着第一个变化 因为传不上图片只能文字描述下面假如AB是拼接好的图片 有A和B拼接成 B的颜色本来是红色但是拼接完成之后B的颜色会变成A的颜色 </code>
AB
The picture is invisible, please do not put the picture in the code view.