<?php
include $_SERVER['DOCUMENT_ROOT'].'/php/GD.php';
header('Content-Type: image/png');
$im=@LoadPNG($_SERVER['DOCUMENT_ROOT'].'/data/pic/shingengo.png')
or die('Cannot Initialize new GD image stream');
$text_color=imagecolorallocate($im, 0, 0, 0); //R,G,B 0~255
$font=$gd_font_microsoft;
if(!empty($_GET['char1'])){
imagettftext($im, 90, 3, 112, 175, $text_color, $font, $_GET['char1']);
}
if(!empty($_GET['char2'])){
imagettftext($im, 90, 3, 125, 295, $text_color, $font, $_GET['char2']);
}
//resource $image , float $size , float $angle , int $x , int $y , int $color , string $fontfile , string $text [, array $extrainfo ]
imagepng($im); //產生圖片
imagedestroy($im); //結束$im釋放記憶體
?>