I'm trying to figure out how all the image manipulation functions work. here's the code I've got so far:
header("Content-type: image/jpeg");
$string = $_GET['toName'];
$im = imagecreatefromjpeg("button.jpg");
$px = (imagesx($im) - 7.5 * strlen($string))/2;
// imagecolorallocate (image, red, green, blue)
$black1 = imagecolorallocate($im, 0, 0, 0);
$white1 = imagecolorallocate($im, 255, 255, 255);
// Set background color of im2
imagefill($im, 0, 0, $white1);
// imagestring(image, font, x, y, string, color)
imagestring($im, 4, $px, 100, $string, $black1);
imagejpeg($im);
imagedestroy($im);
Its my understanding that this should take my image button.jpg, fill the background with white, and write black text. Instead, its filling with an orangy-brown color (r:215, g:188, b:145 according to my paint program). When I take out the imagefill line, I can see that its writing the text with this same orangy-brown color. Any ideas??