colored text in images
| From: | Marcus Gnaß | Date: | Fri, 24 Mar 2006 18:41:06 +0000 |
| Subject: | colored text in images | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-232555@lists.php.net to get a copy of this message | ||
Hi list!
I like to generate a larger image from different tiles. Each tile should have a text on it which should be red for better readability. I figured out how to compose the larger image but got stuck when to color the text. I tried the following code:
$img = imagecreate($w * 100, $h * 100);
$tile = imagecreatefromgif($tile_name);
$red = imagecolorallocate($tile, 255, 0, 0);
imagestring($tile, $font, $gebilde_x, $gebilde_y, $gebilde, $rot);
imagecopy($map, $tile, $dst_x, $dst_y, 0, 0, imagesx($tile), imagesy($tile));
header("Content-Type: image/gif");
imagegif($map);
The text was writte an expected, just it was grey and not red. What do I have to do to make it read and why was it grey?
Marcus