Hey,
I downloaded a script to turn some text into an image but I can't get it to work. Here is the script I have uploaded - http://djclan.auscstrike.com/image.php - and here is the code
PHP Code:
<?php
function text2image($mytext,$imwidth,$imheight) {
if (!empty($mytext)) {
if (empty($imwidth)) $imwidth=500;
if (empty($imheight)) $imheight=400;
Header("Content-type: image/Jpeg");
$im = @ImageCreate ($imwidth=500, $imheight) or die ("Cannot Initialize new GD image stream");
$background_color = ImageColorAllocate ($im, 255, 255, 255);
$text_color = ImageColorAllocate ($im, 0, 0, 0);
$mytext = stripslashes($mytext);
$mytext = ereg_replace("\r\n","\n",$mytext) ;
$count=5;
$returns = explode("\n", $mytext);
while(list($k, $mytext) = each($returns)) {
$count = $count;
$insert_text = substr($mytext, 0);
ltrim($insert_text);
ImageString ($im, 2, 5,$count, $insert_text, $text_color);
imagerectangle ($im, 2, 2, $imwidth-2, $imheight-2, $text_color);
$count=$count+13;
}
ImageJpeg($im);
ImageDestroy;
}
}
text2image("Hello World", 130, 20);
?>
Anyone have any ideas?
Thanks
Bookmarks