Re: Re: imagettftext color problem
| From: | hitek at cox dot net | Date: | Fri, 11 Feb 2005 17:58:06 +0000 |
| Subject: | Re: Re: imagettftext color problem | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-208546@lists.php.net to get a copy of this message | ||
You are using imagecreate() with png, which creates an indexed color image.
> $img=imagecreate($width, $height);
Use Imagecreatetruecolor() instead.
>
> From: Anni Hienola <anni.hienola@helsinki.fi>
> Date: 2005/02/11 Fri AM 02:27:03 EST
> To: php-general@lists.php.net
> Subject: [PHP] Re: imagettftext color problem
>
>
> And to correct one mistake in the code that was kindly pointed out but is
> here just a typo:
>
> > $bg=imagecolorallocate($img, 255, 255, 255);
> > $font_color=imageallocatecolor($img, 0, 0, 0);
>
> Should be:
> $bg=imagecolorallocate($img, 255, 255, 255);
> $font_color=imagecolorallocate($img, 0, 0, 0);
>
> Full error check is on and the colors are correctly indexed as far as I
> can tell, but the TTF text stubbornly shows up yellow.
>
> Anni H.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>