1
require_once( "view.php" ); ?>
1
session_start(); header("Content-type: image/png"); header( "Expires: Wed, 31 May 2000 14:59:58 GMT" ); mb_language( "ja" ); mb_internal_encoding("EUC-JP"); # シード $name_seed = array(); $name_seed[] = "亜哀愛悪芦圧飴"; $name_seed[] = "侍児字寺時次示"; $name_seed[] = "あいうえおらん"; $names = array(); $n1 = mb_substr( $name_seed[0], rand( 0, mb_strlen($name_seed[0])-1 ), 1 ); $n2 = mb_substr( $name_seed[1], rand( 0, mb_strlen($name_seed[1])-1 ), 1 ); $n3 = mb_substr( $name_seed[2], rand( 0, mb_strlen($name_seed[2])-1 ), 1 ); $img_text = mb_convert_encoding( $n1 . $n2 . $n3, "UTF-8", "EUC-JP" ); $_SESSION['check_target'] = mb_convert_encoding( $n1 . $n2 . $n3, "SHIFT_JIS", "EUC-JP" ); $font_path = "./mikachan.ttf"; # ********************************************************** # キャンバス作成 # ********************************************************** $im = imagecreate( 150, 30 ); # *********************************************************** # 画像の背景色 # imagecolorallocate() の最初のコールで背景色がセットされます # *********************************************************** $white = imagecolorallocate( $im, 255, 255, 255 ); # *********************************************************** # 画像の文字色 # *********************************************************** $black = imagecolorallocate( $im, 0, 0, 0 ); imagettftext( $im, 20, # サイズ 0, # 角度 5, # x 座標 25, # y 座標 $black, $font_path, $img_text); # *********************************************************** # PNG 出力 # *********************************************************** imagepng($im); # *********************************************************** # 終了処理 # *********************************************************** imagecolordeallocate( $im, $black ); imagecolordeallocate( $im, $white ); imagedestroy($im); ?>