ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Transparente Chart + Dark Image Background
Posted by Omar on Jun-08-2011 23:07
Attachments:
Hi Peter,

I'm setting the chart to be Transparent with a black image background, but the chart is  showing a white line around the border of the chart.

How can I avoid this behavior?

I'm using: $this->c->setTransparentColor(0xFFFFF0);

Any ideas??

Thanks
Transparent.JPG

  Re: Transparente Chart + Dark Image Background
Posted by Peter Kwan on Jun-09-2011 02:06
Hi Omar,

The "white line" is caused by your original background color 0xFFFFF0, which is nearly white.

At the edge of some objects (eg. a pie sector), because of anti-alias, your 0xFFFFF0 color will mix up with the sector color to create smooth anti-alias effect. So the color there is not exact 0xFFFFF0, but is still quite light. As you are using single color transparency, only 0xFFFFF0 will be treated as transparent. the mixed up edge color will not be treated as transparent. When you use a dark background, you will see it clearly as a light color border.

To solve the problem, there are two methods:

(a) Use alpha transparency. This is the perfect method to use transparency with anti-alais. However, note that IE 6 does not support alpha transparency (it will change the transparent color into grey). IE 7 or above, FireFox, Chrome and Safari supports alpha transparency. To use alpha transparency, please use Transparent as the background color, and then use $this->c->setTransparentColor(-1);

or

(b) Instead of using 0xFFFFF0 as the background color, please use background color very close to your real background, such as 0x010101 for your current case (and setTransparentColor(0x010101)). Although the border still exists, it is very hard to notice.

Hope this can help.

Regards
Peter Kwan

  Re: Transparente Chart + Dark Image Background
Posted by Omar on Jun-09-2011 05:50
Thanks Peter