»新元號產生器
»原始碼
<?php function LoadPNG($imgname){ $im=@imagecreatefrompng($imgname); if(!$im){ /* Create a blank image */ $im=imagecreatetruecolor(150, 30); $bgc=imagecolorallocate($im, 50, 50, 50); $tc=imagecolorallocate($im, 0, 0, 0); imagefilledrectangle($im, 0, 0, 150, 30, $bgc); imagestring($im, 1, 5, 5, 'Error loading ' . $imgname, $tc); } return $im; } 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 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釋放記憶體 ?>
»按讚訂閱分享

0 則留言