2013-06-06 4 views
0

GD 라이브러리를 사용하여 이미지 위에 이미지를 복사하고 있지만 제대로 표시되지 않습니다. 이건 내 코드입니다 :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); 
?> 
난으로 인해 충분한 명성에 이미지를 업로드 할 수 없습니다하지만 난 설명 할 수

이 내가 다른 이미지를 통해 중복해야하지만, 어디에서 웃는있을 때 나는이 기능을 회색 색상 상자를 실행할 때 스마일 대신 이미지에 겹쳐서 표시됩니다. 웃는 얼굴도 회색입니다. 이 이미지에 대한 링크 기능 후에 만드는 것입니다

도와주세요 ... 난이

http://classicsouls.com/main/smile7.png

+1

[imgur.com] (http://imgur.com)에서 호스팅하는 이미지에 대한 링크를 게시하면 다른 사람이 내 게시물에 맞게 수정합니다. – Bojangles

답변

0

하려고이 이미지를 중첩 할

http://classicsouls.com/main/9695.png

실행 $im에 대해서도 imagealphablending을 설정하십시오.

$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);