[Mapserver-users] PNG Transparency in Internet Explorer - Solution

Doug Cates doug at moximedia.com
Thu Dec 18 14:48:01 PST 2003


David,

1. Is this an IIS server only solution, or will it work with other
engines?

2. Isn't it only 24-bit PNG that browsers have trouble with? If so, USGS
should output the images in 8-bit PNG or GIF in order for their services
to be as interoperable as possible. The same holds true for people
publixhing WMS services using MapServer. 

Doug



On Thu, 2003-12-18 at 12:59, Lowther, David W wrote:
> Hi List,
> 
> Thought this might prove useful to someone...
> 
> Problem:
> 
> Internet Explorer does not correctly render transparency in PNG
> images.
> 
> Solution:
> 
> This needs to go in the <head> of the HTML file that will display a
> PNG:
> 
> <style type="text/css">
> img { behavior: url("pngbehavior.htc"); }
> </style>
> 
> Alternatively, the following line may be included in a CSS
> (Stylesheet) that is used by the page:
> img { behavior: url("pngbehavior.htc"); }
> 
> It is only required by Internet Explorer, but will not cause problems
> in other browsers.
> 
> Also, the attached pngbehaviour.htc file must be present in the
> directory of the HTML files displaying PNG images and the spacer.gif
> must be accessible to the pngbehaviour.htc script (default is
> images/spacer.gif).
> 
> 
> <<pngbehavior.zip>>  <<spacer.zip>> 
> 
> We came across this issue when using Mapserver as our WMS for the USGS
> National Map. Our layers obscured everything below them in Internet
> Explorer, but were correctly transparent in Mozilla. When USGS
> implements this things should be OK in Internet Explorer also.
> 
> 
> David Lowther
> Software Engineer
> GEO Information Systems
> University of Oklahoma
> dlowther at ou.edu
> (405) 325-3131
> http://www.geo.ou.edu
> 
> 
> 




More information about the MapServer-users mailing list