画像にテキスト
の編集
https://yassu.jp/pukiwiki/index.php?%B2%E8%C1%FC%A4%CB%A5%C6%A5%AD%A5%B9%A5%C8
[
トップ
] [
編集
|
差分
|
バックアップ
|
添付
|
リロード
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
]
-- 雛形とするページ --
(no template pages)
掲示板で画像に5桁の数字を表示させて、それに一致しないと投稿不可みたいなやつ <?php $image = ImageCreate(50, 20); $background_color = ImageColorAllocate($image, 0, 0, 0); $text_color = ImageColorAllocate($image, 255, 255, 255); $text = rand(10000, 99999); // image, font-size, angle, x, y, coloe, font-file, text ImageTTFText($image, 10, 0, 5, 15, $text_color, "/usr/share/fonts/bitstream-vera/Vera.ttf", $text); $time = time(); $image_path = "./auth/{$time}.gif"; ImageGif ($image, $image_path); ImageDestroy($image); chmod($image_path, 0666); $text_path = "./auth/{$time}.txt"; file_put_contents($text_path, $text); chmod($text_path, 0666); ?>
タイムスタンプを変更しない
掲示板で画像に5桁の数字を表示させて、それに一致しないと投稿不可みたいなやつ <?php $image = ImageCreate(50, 20); $background_color = ImageColorAllocate($image, 0, 0, 0); $text_color = ImageColorAllocate($image, 255, 255, 255); $text = rand(10000, 99999); // image, font-size, angle, x, y, coloe, font-file, text ImageTTFText($image, 10, 0, 5, 15, $text_color, "/usr/share/fonts/bitstream-vera/Vera.ttf", $text); $time = time(); $image_path = "./auth/{$time}.gif"; ImageGif ($image, $image_path); ImageDestroy($image); chmod($image_path, 0666); $text_path = "./auth/{$time}.txt"; file_put_contents($text_path, $text); chmod($text_path, 0666); ?>
テキスト整形のルールを表示する