GD Help(Text color)
Posted: Sun Nov 20, 2005 2:31 pm
I have a basic script, which lets you just put txt=something here and it prints that out in the image, well, im trying to take it a little further, and im trying to get it to have gradient font, I havent the slightest clue on how I could do that...I can do single colors, but im not sure how I could get a gradient, Can anyone help me here?
here is my code:
here is my code:
Code: Select all
<?php
header("Content-type: image/png");
$string = $_GET['txt'];
$length=strlen($string) * 8.5;
$im = imagecreate($length, 17);
//Set the BG color.
$background_color = imagecolorallocate($im, 0, 0, 0);
//Now the Text Color.
$text_color = imagecolorallocate($im, 100, 100, 255);
//The image string, which is the txt, from the URL.
imagestring($im, 3, 4, 0, $string, $text_color);
//transparency stuff
ImageColorTransparent($im,0);
//Output the Image
imagepng($im);
//Destroy it, freeing memory.
imagedestroy($im);
?>