Helo their,
I have made an image with text over it, like this... www.gettodachoppa.com/tester.php
here is my code:
<?php
if (isset($_GET['submit']))
{
header("Content-type: image/png");
$im = @imagecreate(100, 50)
or die();
$background_color = imagecolorallocate($im, $_GET['r'], $_GET['g'], $_GET['b']);
$text_color = imagecolorallocate($im, $_GET['r1'], $_GET['g1'], $_GET['b1']);
imagestring($im, 3, 5, 5, $_GET['t'], $text_color);
imagepng($im);
imagedestroy($im);
}
else
{
echo '<form method="get" action="">
<input type="text" size="2" maxlength="3" name="r">
<input type="text" size="2" maxlength="3" name="g">
<input type="text" size="2" maxlength="3" name="b"> Background Color (RGB)
<p>
<input type="text" size="2" maxlength="3" name="r1">
<input type="text" size="2" maxlength="3" name="g1">
<input type="text" size="2" maxlength="3" name="b1"> Text Color (RGB)
<p>
<input type="text" name="t"> Text<br>
<input type="submit" name="submit">
</form>';
}
?>
Now ere is my problem.
I need this in hex codes and not rgb's. this is important. anyone know how?
also, i need to figure out how to implement wordwrap (or something) so that the image doesn't cut off large words. can anyone help with this?