Re: Re[2]: [PHP] imagecolortransparent()
| From: | Nick | Date: | Tue, 23 Jul 2002 19:56:13 +0000 |
| Subject: | Re: Re[2]: [PHP] imagecolortransparent() | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-109138@lists.php.net to get a copy of this message | ||
thanks it worked ^^
-Nick
"Tom Rogers" <trogers@kwikin.com> wrote in message
news:2735331183.20020723134503@kwikin.com...
> Hi,
>
> Tuesday, July 23, 2002, 5:16:43 AM, you wrote:
>
> N> "Tom Rogers" <trogers@kwikin.com> wrote in message
> N> news:16878540805.20020722210409@kwikin.com...
> >> Hello Nick,
> >>
> >> Monday, July 22, 2002, 8:47:39 PM, you wrote:
> >>
> >> N> i get php to allocate a colour then make it transparent using
> >> N> imagecolortransparent()
> >>
> >> N> instead of turning it transparent it becomes black.
> >>
> >> N> Is it something i'm doing wrong? can anyone help me?
> >>
> >> N> thanx in advance
> >>
> >> Post a bit of the code so we can see what you are doing
> >>
> >> --
> >> Tom
> >>
>
> N> $im = imagecreate($size, 21);
>
> N> $bgcolour =
> N>
imagecolorallocate($im,hexdec(substr($table[bg],0,2)),hexdec(substr($table[b
> N> g],2,2)),hexdec(substr($table[bg],4,2)));
> N> $fontcolour =
> N>
imagecolorallocate($im,hexdec(substr($table[fg],0,2)),hexdec(substr($table[f
> N> g],2,2)),hexdec(substr($table[fg],4,2)));
>
> N> if ($table[bg] == "no") {
> N> $trans = imagecolortransparent ($im,$bgcolour);
> N> }
>
> probably what you need is:
>
> $im = imagecreate($size, 21);
> if ($table[bg] == "no") {
> $bgcolour = imagecolorallocate($im,1,1,1);
> $trans = imagecolortransparent ($im,$bgcolour);
> }
> else{
> $bgcolour =
imagecolorallocate($im,hexdec(substr($table[bg],0,2)),hexdec(substr($table[b
g],2,2)),hexdec(substr($table[bg],4,2)));
> }
> $fontcolour =
imagecolorallocate($im,hexdec(substr($table[fg],0,2)),hexdec(substr($table[f
g],2,2)),hexdec(substr($table[fg],4,2)));
>
>
>
>
>
> --
> Best regards,
> Tom
>