웹마스터 팁
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
배경그림과 글자색상,배경색상을 지정해주는 php스크립트
2002.07.07 14:07
http://club.sayclub.com/myclub_index.nwz?clubid=javaapplet<script language=php>
// YoShi - php4zend@hotmail.com
// webpage http://yoshi.play.co.kr
Header("Content-type: image/png"); // 이미지 형식을 정한다. (Gif 도 됨)
if(!isset($s)) $s=20; // 글자 크기를 지정한다
if(!isset($text)) $text=YoShi; // $text 변수가 없을때 나올 텍스트
if(!isset($font)) $font="font3.TTF"; // 폰트를 정한다
$size = imagettfbbox($s,0,$font,$text);
$xpad = 100; // 가로크기
$ypad = 100; // 세로크기
$im = imagecreate($xpad+100,$ypad+100);
ImageColorAllocate($im,0xff,0xff,0xff); // 배경색
$white = ImageColorAllocate($im,0x66,0x66,0xFF); // 글자색
ImageTTFText($im,$s,45,(int)($xpad-20),(int)($ypad+20),$white,$font,$text);
ImagePNG($im);
ImageDestroy($im);
</script>
http://club.sayclub.com/myclub_index.nwz?clubid=javaapplet 동호회에서 알게되었습니다.
위에 있는
// YoShi - php4zend@hotmail.com
// webpage http://yoshi.play.co.kr
분이 직접 프로그래밍하셨는가봐요..^^ 좋은것 같아 올립니다..^^
// YoShi - php4zend@hotmail.com
// webpage http://yoshi.play.co.kr
Header("Content-type: image/png"); // 이미지 형식을 정한다. (Gif 도 됨)
if(!isset($s)) $s=20; // 글자 크기를 지정한다
if(!isset($text)) $text=YoShi; // $text 변수가 없을때 나올 텍스트
if(!isset($font)) $font="font3.TTF"; // 폰트를 정한다
$size = imagettfbbox($s,0,$font,$text);
$xpad = 100; // 가로크기
$ypad = 100; // 세로크기
$im = imagecreate($xpad+100,$ypad+100);
ImageColorAllocate($im,0xff,0xff,0xff); // 배경색
$white = ImageColorAllocate($im,0x66,0x66,0xFF); // 글자색
ImageTTFText($im,$s,45,(int)($xpad-20),(int)($ypad+20),$white,$font,$text);
ImagePNG($im);
ImageDestroy($im);
</script>
http://club.sayclub.com/myclub_index.nwz?clubid=javaapplet 동호회에서 알게되었습니다.
위에 있는
// YoShi - php4zend@hotmail.com
// webpage http://yoshi.play.co.kr
분이 직접 프로그래밍하셨는가봐요..^^ 좋은것 같아 올립니다..^^
(태클 걸어서 죄송;;)