RE: [PHP] using transparent images in a style
| From: | NCI/IMS) | Date: | Thu, 25 Apr 2002 16:54:58 +0000 |
| Subject: | RE: [PHP] using transparent images in a style | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-94581@lists.php.net to get a copy of this message | ||
More info in case this helps:
I tried taking out the transparencies and changing the $this->trans to
$this->black and I'm still getting a solid line of the wrong color green
(the correct green is in a different place, so it's obvious this is wrong).
Do you think that if I included the picture as a .bmp it would help?
-----Original Message-----
From: Leotta, Natalie (NCI/IMS)
Sent: Thursday, April 25, 2002 10:41 AM
To: php-general@lists.php.net
Subject: [PHP] using transparent images in a style
Hi. I'm trying to make lines based on dots and dashes and I need the colors
in the middle to be transparent. This is all done within a class, that's
why there are "$this->"s all over.
$t = ImageColorAllocate($this->im,1,1,1);
$this->trans = ImageColorTransparent($this->im,$t);
$this->style =
array($this->color,$this->trans,$this->color,$this->trans,$this->trans,$this
->trans,$this->trans,$this->trans);
ImageSetStyle($this->im, $this->style);
//these are all defined and it is drawing the line, just not doing the
transparencies
ImageLine($this->im,($widthPoint+(($indexstart)*$this->xscale)),$starty,($wi
dthPoint+(($indexend)*$this->xscale)), $endy, IMG_COLOR_STYLED);
I got this code out of the manual and I also tried using
IMG_COLOR_TRANSPARENT instead of $this->trans in the style array.
Not only do I not get any form of a dotted or dashed line (I added all those
transparents so I could see openings in the line) but the line color changed
from a tealish green to a sick green. I'm using ImageCreate instead of
ImageCreateTrueColor.
Has anyone run into similar problems? Thanks!
-Natalie
Natalie S. Leotta
Information Management Services, Inc.
(301) 680-9770
LeottaN@ims.nci.nih.gov