GD 그림과 텍스트 합치기
페이지 정보
작성자 서방님 댓글 0건 조회 126회 작성일 16-07-22 10:37본문
<?
// 그림과 텍스트 합치기
header ("Content-type: image/png");
$fontname = "MALGUN.TTF";
$width = "500";
$height = "500";
$im=ImageCreate($width,$height); // 이미지의 크기를 정합니다.
$im2 = imagecreatefromjpeg("kim.jpg"); //imagecreatefromgif
$white = ImageColorAllocate ($im, 255, 255, 255);// 사용할 색상 설정
$gray = ImageColorAllocate($im,0,0,0); // 사용할 색상 설정
ImageCopyMerge ($im, $im2, 0, 0, 0, 0, 500,500,50);
ImageRectangle($im,0,0,500,500, $gray);
ImageTTFText($im2,20,0,5,128,$gray,$fontname,"PHP for GD...");
ImagePNG($im2);
ImageDestroy($im); // 이미지에 사용한 메모리 제거
?>
댓글목록
등록된 댓글이 없습니다.