Your IP : 216.73.216.40


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

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

// 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 = 'BAUHS93.TTF';//$fonts[$no];

$i = imageloadfont($font);
////$im = imagecreatetruecolor(800, 43);
$im = imagecreatefromjpeg($img);

$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);

// Create some colors
////$transparent_color = imagecolorallocate($im, 255, 255, 255);
////imagecolortransparent($im, $transparent_color);
////imagefilledrectangle($im, 0, 0, 799, 42, $transparent_color);

// Draw the ellipse.
//imagefilledellipse($im, 400, 21, 799, 84, $transparent_color);

// Add the text
imagettftext($im, 24, 0, 50, 30, $black, $font, $title);

//imagefilledarc($im, 4, 40, 800, 40, 1, 799, $black, IMG_ARC_EDGED);

// Add some shadow to the text
//imagettftext($im, 26, 0, 0, 31, $black, $font, $title);

// Using imagepng() results in clearer text compared with imagejpeg()
imagepng($im);
imagedestroy($im);
?>