using transparent images in a style
| From: | NCI/IMS) | Date: | Thu, 25 Apr 2002 14:40:38 +0000 |
| Subject: | using transparent images in a style | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-94568@lists.php.net to get a copy of this message | ||
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