Re: colored text in images

From: Date: Fri, 24 Mar 2006 19:21:49 +0000
Subject: Re: colored text in images
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-232557@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
Marcus: Instead of: imagestring($tile, $font, $gebilde_x, $gebilde_y, $gebilde, $rot); Try using this (if you have FreeType Functions): ImageTTFText ($im, $gebilde, $rot, $gebilde_x, $gebilde_y, $red, $font, $tile); If you don't have FreeType Functions see: http://www.weberdev.com/get_example-131.html tedd -- -------------------------------------------------------------------------------- http://sperling.com

« previous php.general (#232557) next »