Viewing file: mytext-convert-to-jpg-image.php (771 B) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
header("Content-type: image/jpeg"); $mytext = $_GET['mytext']; $fontsize = 5; $wide = imagefontwidth($fontsize) * strlen($mytext) + 20; $high = imagefontheight($fontsize) + 20; $picture = imagecreatetruecolor($wide,$high); $gray = imagecolorallocate($picture,223,223,223); $blue = imagecolorallocate($picture,0,0,255); imagefill($picture,0,0,$gray); $black=imagecolorallocate($picture, 0, 0, 0); imageline($picture, 0, 0, 0, $high, $black); imageline($picture, 0, 0, $wide, 0, $black); imageline($picture, $wide-1, 0, $wide-1, $high-1, $black); imageline($picture, 0, $high-1, $wide-1, $high-1, $black); imagestring($picture,$fontsize,10,10,$mytext,$blue); imagejpeg($picture); imagejpeg($picture,"mytextpic.jpg"); imagedestroy($picture);
?>
|