MapServer / MapServer-import

3 stars 2 forks source link

legend icons and transparency alpha for pixmap #1250

Open tbonfort opened 12 years ago

tbonfort commented 12 years ago

Reporter: pierre.giraud@camptocamp.com Date: 2005/02/18 - 11:24

Somes recent fixed bugs relative to the use of pixmaps and RGBA
outputformat modes. I have to use "TRANSPARENCY ALPHA" in each layer
using pixmap symbol.
The map is rendered correctly.
But as far as I'm generating on the fly legend icons with the
createLegendIcon mapscript function some errors with transparency appear
on IExplorer.
First if TRANSPARENT is set to ON in the OUTPUTFORMAT (or in the MAP),
some grey color appear in alpha place.
In fact, IE does not support 32bits PNG. The solution should be given by
the ".htc" method but it is high client computing cost (file transfert
for each new page load).

What could be an alternative for my case is to take advantage of the
IMAGECOLOR in the LEGEND object and set the TRANSPARENT to OFF in
OUTPUTFORMAT ("transparent" in legend object is now deprecated). I
thought it acts like a background color . I would like the pixmap symbol
to be sticked on this background-color.

But it seems that the TRANSPARENCY ALPHA has no effect on the legend icons.

What would be appreciated is that in the usecase joined the legend icons appear
with the pixmap symbol on a red background.
Colors are volontary chosen flashy to identify possible problems.
tbonfort commented 12 years ago

Author: sgillies@frii.com Date: 2005/02/18 - 17:21

Pierre, this is the best bug report ever!  thanks :)  I've set the target for
the 4.6 release (approx. June 2005) and if it is an easy fix, will fix it for
the 4.4.2 release as well.
tbonfort commented 12 years ago

Author: sgillies@frii.com Date: 2005/02/18 - 18:42

I spoke too soon ... there are no pixmap symbols in the attachment.  Can you
attach 4.gif and 6.png?
tbonfort commented 12 years ago

Author: sgillies@frii.com Date: 2005/02/18 - 20:07

OK, I have committed a fix to the MapServer CVS HEAD.

I am attaching a maplegend.c file for MapServer 4.4.  Would you be 
willing to test it for me?  If it works, I'll commit it to the MapServer 4.4
branch.
tbonfort commented 12 years ago

Author: sgillies@frii.com Date: 2005/02/18 - 20:35

It also just occurred to me that the easy solution for your particular problem
is to change your map's outputformat to a PCT PNG immediately before drawing
these particular legend icons.
tbonfort commented 12 years ago

Author: pierre.giraud@camptocamp.com Date: 2005/02/22 - 14:51

Sorry, I weren't able to test it quickly.
Even so, the bug seem to be fixed. I let you change its resolution.
Thanks for all.
tbonfort commented 12 years ago

Author: sgillies@frii.com Date: 2005/02/22 - 16:02

Thanks, Pierre.