Re: [PHP] ImageColorTransparent Problem

2004-08-09 Thread Lester Caine
Kevin wrote:
Yes, I have tried making the image with imagecreate() function and it was
transparent. Using imagecreate() function I was only able to make 256 colors
but the image was transparent. I want real colors so I used
imagecreatetruecolor() and now the same is not transparent.
THAT is a bug in IE as far as I have established. PSP kept insisting on 
switching to palette mode when I select transparent, and on asking 
elsewhere I was told IE can't handle anything more.
Since I can't create the picture - I haven't had a chance to check in 
Mozilla/Firefox :)

--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] ImageColorTransparent Problem

2004-08-08 Thread Kevin
Hi,

I am having PHP Version 4.3.4 with GD 2.0.15 compatible and PNG support
enabled.

My problem with the following code is that the image produced be this code
is not transparent. It has a black background. I have viewed it in IE 6 and
its not transparent.

Can someone help me how to make this image transparent?

?php

// imagecolorallocate ( resource image, int red, int green, int blue)
// imagettftext ( resource image, float size, float angle, int x, int y, int
color, string fontfile, string text)
// imagepng ( resource image [, string filename])
// imagecreatetruecolor ( int x_size, int y_size)
// imagecolortransparent ( resource image [, int color])

header(Content-type: image/png);
$im = imagecreatetruecolor(400,600); // i have used imagecreatetruecolor in
place of imagecreate()
$bg = imagecolorallocate($im, 0, 0, 0);
imagecolortransparent($im, $bg); // this function makes the color
transparent specified in $bg.

$j=0;
$k = 0;
$r = 1;
$g = 100;
$b = 20;

for($i=1;$i=50;$i++)
{
 if($r  255)
  $r = 1;
 if($g  255)
  $g = 100;
 if($b  255)
  $b = 20;

 $textcolor = imagecolorallocate($im, $r, $g, $b);
 $r = $r * 3;
 $g = $g + 10;
 $b = $b + 20;

 imagettftext($im, 10, 0, 0, $j, $textcolor, fonts/2.ttf, Row number
: $i | Color =  . $textcolor);
 $j=$j+12;
}
imagepng($im,kk.png);
?

Thanks a lot for reading this far.
-- 
Kevin

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] ImageColorTransparent Problem

2004-08-08 Thread Jason Davidson
Does IE even support PNG transparncy properly anyways??? maybe thats the
issue here?

Jason
Kevin [EMAIL PROTECTED] wrote: 
 
 Hi,
 
 I am having PHP Version 4.3.4 with GD 2.0.15 compatible and PNG support
 enabled.
 
 My problem with the following code is that the image produced be this code
 is not transparent. It has a black background. I have viewed it in IE 6 and
 its not transparent.
 
 Can someone help me how to make this image transparent?
 
 ?php
 
 // imagecolorallocate ( resource image, int red, int green, int blue)
 // imagettftext ( resource image, float size, float angle, int x, int y, int
 color, string fontfile, string text)
 // imagepng ( resource image [, string filename])
 // imagecreatetruecolor ( int x_size, int y_size)
 // imagecolortransparent ( resource image [, int color])
 
 header(Content-type: image/png);
 $im = imagecreatetruecolor(400,600); // i have used imagecreatetruecolor in
 place of imagecreate()
 $bg = imagecolorallocate($im, 0, 0, 0);
 imagecolortransparent($im, $bg); // this function makes the color
 transparent specified in $bg.
 
 $j=0;
 $k = 0;
 $r = 1;
 $g = 100;
 $b = 20;
 
 for($i=1;$i=50;$i++)
 {
  if($r  255)
   $r = 1;
  if($g  255)
   $g = 100;
  if($b  255)
   $b = 20;
 
  $textcolor = imagecolorallocate($im, $r, $g, $b);
  $r = $r * 3;
  $g = $g + 10;
  $b = $b + 20;
 
  imagettftext($im, 10, 0, 0, $j, $textcolor, fonts/2.ttf, Row number
 : $i | Color =  . $textcolor);
  $j=$j+12;
 }
 imagepng($im,kk.png);
 ?
 
 Thanks a lot for reading this far.
 -- 
 Kevin
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] ImageColorTransparent Problem

2004-08-08 Thread Matthew Runo
Have you tried it in other browsers? IE 6 / windows PNG support leaves 
much to be desired, even more so when we want them to be transparent.

Try it in Firefox, or some other similar browser. Same results?
Matthew Runo
http://www.quabbo.com
Quabbo Internet Services
The only host with the Zend Performance Suite!
On Aug 8, 2004, at 9:32 PM, Kevin wrote:
Hi,
I am having PHP Version 4.3.4 with GD 2.0.15 compatible and PNG support
enabled.
My problem with the following code is that the image produced be this 
code
is not transparent. It has a black background. I have viewed it in IE 
6 and
its not transparent.

Can someone help me how to make this image transparent?
?php
// imagecolorallocate ( resource image, int red, int green, int blue)
// imagettftext ( resource image, float size, float angle, int x, int 
y, int
color, string fontfile, string text)
// imagepng ( resource image [, string filename])
// imagecreatetruecolor ( int x_size, int y_size)
// imagecolortransparent ( resource image [, int color])

header(Content-type: image/png);
$im = imagecreatetruecolor(400,600); // i have used 
imagecreatetruecolor in
place of imagecreate()
$bg = imagecolorallocate($im, 0, 0, 0);
imagecolortransparent($im, $bg); // this function makes the color
transparent specified in $bg.

$j=0;
$k = 0;
$r = 1;
$g = 100;
$b = 20;
for($i=1;$i=50;$i++)
{
 if($r  255)
  $r = 1;
 if($g  255)
  $g = 100;
 if($b  255)
  $b = 20;
 $textcolor = imagecolorallocate($im, $r, $g, $b);
 $r = $r * 3;
 $g = $g + 10;
 $b = $b + 20;
 imagettftext($im, 10, 0, 0, $j, $textcolor, fonts/2.ttf, Row 
number
: $i | Color =  . $textcolor);
 $j=$j+12;
}
imagepng($im,kk.png);
?

Thanks a lot for reading this far.
--
Kevin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] ImageColorTransparent Problem

2004-08-08 Thread Kevin

Jason Davidson [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Does IE even support PNG transparncy properly anyways??? maybe thats the
 issue here?

Yes, I have tried making the image with imagecreate() function and it was
transparent. Using imagecreate() function I was only able to make 256 colors
but the image was transparent. I want real colors so I used
imagecreatetruecolor() and now the same is not transparent.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php