이미지에 글자쓰기 > 개발자팁

개발자팁

개발과 관련된 유용한 정보를 공유하세요.
질문은 QA에서 해주시기 바랍니다.

이미지에 글자쓰기 정보

PHP 이미지에 글자쓰기

본문

요즘은 html5로 많이 사용하지만

프로그램을 입힐 경우 유용해보입니다.

 

$im = imagecreatetruecolor(300, 100);

$red = imagecolorallocate($im, 0xFF, 0x00, 0x00);

$black = imagecolorallocate($im, 0x00, 0x00, 0x00);

 

imagefilledrectangle($im, 0, 0, 299, 99, $red);

 

$font_file = '/font/NanumGothic.ttf';

 

imagefttext($im, 13, 0, 105, 55, $black, $font_file, 'PHP Manual');

 

header('Content-Type: image/png');

 

imagepng($im);

imagedestroy($im);

추천
0
  • 복사

댓글 0개

© SIRSOFT
현재 페이지 제일 처음으로