Your IP : 216.73.216.40


Current Path : /var/www/html/mmishra/mm/air1/
Upload File :
Current File : /var/www/html/mmishra/mm/air1/text2image.php

<?php
$title = $_REQUEST["title"];

// Set the content-type
header('Content-type: image/png');

// Create the image
$fonts = array('HTOWERT.TTF','MTCORSVA.TTF','BAUHS93.TTF','georgia.TTF');
$no = rand(0,3);
$font = $fonts[$no];

$i = imageloadfont($font);
$im = imagecreatetruecolor(900, 45);

// Create some colors
$black = imagecolorallocate ($im, rand(0,255), rand(0,255), rand(0,255));
//$grey = imagecolorallocate ($im, rand(0,255), rand(0,255), rand(0,255));
//$white = imagecolorallocate($im, 255, 255, 255);

//$transparent_color = imagecolorallocate($im, 255, 0, 0);
$transparent_color = imagecolorallocate($im, 255, 255, 255);
imagecolortransparent($im, $transparent_color);
imagefilledrectangle($im, 0, 0, 899, 45, $transparent_color);

// Add some shadow to the text
//imagettftext($im, 32, 0, 0, 31, $grey, $font, $title);
// Add the text
imagettftext($im, 32, 0, 1, 40, $black, $font, $title);
// Using imagepng() results in clearer text compared with imagejpeg()
imagepng($im);
imagedestroy($im);
?>