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

Lowther, David W dlowther at ou.edu
Thu Dec 18 15:59:54 EST 2003


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_000_01C3C5A9.E2DAF090
Content-Type: multipart/alternative;
	boundary="----_=_NextPart_001_01C3C5A9.E2DAF090"


------_=_NextPart_001_01C3C5A9.E2DAF090
Content-Type: text/plain

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 <http://www.geo.ou.edu> 
> 
> 
> 

------_=_NextPart_001_01C3C5A9.E2DAF090
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3DUS-ASCII">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2653.12">
<TITLE>PNG Transparency in Internet Explorer - Solution</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2 FACE=3D"Arial">Hi List,</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Thought this might prove useful to =
someone...</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Problem:</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Internet Explorer does not correctly =
render transparency in PNG images.</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Solution:</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">This needs to go in the &lt;head&gt; =
of the HTML file that will display a PNG:</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">&lt;style =
type=3D&quot;text/css&quot;&gt;</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">img { behavior: =
url(&quot;pngbehavior.htc&quot;); }</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">&lt;/style&gt;</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Alternatively, the following line may =
be included in a CSS (Stylesheet) that is used by the page:</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">img { behavior: =
url(&quot;pngbehavior.htc&quot;); }</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">It is only required by Internet =
Explorer, but will not cause problems in other browsers.</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">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).</FONT></P>
<BR>

<P><FONT FACE=3D"Arial" SIZE=3D2 COLOR=3D"#000000"> =
&lt;&lt;pngbehavior.zip&gt;&gt; </FONT><FONT FACE=3D"Arial" SIZE=3D2 =
COLOR=3D"#000000"> &lt;&lt;spacer.zip&gt;&gt; </FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">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.</FONT></P>
<BR>

<P><FONT SIZE=3D2 FACE=3D"Arial">David Lowther</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">Software Engineer</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">GEO Information Systems</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">University of Oklahoma</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">dlowther at ou.edu</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">(405) 325-3131</FONT>
<BR><A HREF=3D"http://www.geo.ou.edu"><U><FONT COLOR=3D"#0000FF" =
SIZE=3D2 FACE=3D"Arial">http://www.geo.ou.edu</FONT></U></A>
</P>
<BR>
<BR>

</BODY>
</HTML>
------_=_NextPart_001_01C3C5A9.E2DAF090--

------_=_NextPart_000_01C3C5A9.E2DAF090
Content-Type: application/octet-stream;
	name="pngbehavior.zip"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
	filename="pngbehavior.zip"

UEsDBBQAAAAIAACXQy8ddBtgOgIAAAIFAAAPAAAAcG5nYmVoYXZpb3IuaHRjlVRda9swFH1uIP/h
xozGpsOGje6jiQel60Oh2cMy2GDdgyJfOyK2JCQ5/dj63yfJlpO0D+sUYpDuveeec67suWxXNaNn
VDRScOTm03g078+IMYSuAbf2OI8El0pIVOaergmvMAKb34VC4MIHijiJIHM4miomHeJ4tCUKdCul
UAYLyCFbLK8uIT69SU+TPz/fvf/w8VeWGtQm5mTLKmKESluN6ryyHRI4PobduayJKYVqIM8h+s74
2zfRrOugkNRLRfvdqiZ8Y7e2XcQaUqHOtCQUVVqx0pWMR6yEeKCVQMnurlxinPho2XJqmODwTCD8
Ho8AwJVP9uoVmlbxmY/5h6Mhv5AGLQdvVhqg3OFsAOlyJpaoVjQ6BMoyl8KFAY0GjOh0DaUwAY63
8BWryzsZB81JZ6ZFSxKfateBusdDhbtYL812rWw7CzAI0d5KrLFxQrT3+ahP7p23cXceToGukW7A
DsuPBrqbM1D3gHmYWuhs114Pixg0zUJ4351HJ+PFVuxaWHIrQjetBFEXg0wP/kTJkUsmtR1aHJj2
AncPi+aaeKWSVztG2U1q96/6ux3AUyOuxS2qC6Kd4+63T8zN2bMHf21f6EpfWLLaoHpao1puWINL
c19j2qW418LexooVZ59/+OF/U4Rr92alC0aV0KI06Xkt18RHrwUpUDkf82kEJ6HDP5YjewLR9LVm
D4xXCzRrUeRTTa2j0yQahgiOq8YDHxQ2Yov/p2gP0f797Zhnw4donj373v0FUEsBAhQAFAAAAAgA
AJdDLx10G2A6AgAAAgUAAA8AAAAAAAAAAQAgALaBAAAAAHBuZ2JlaGF2aW9yLmh0Y1BLBQYAAAAA
AQABAD0AAABnAgAAAAA=

------_=_NextPart_000_01C3C5A9.E2DAF090
Content-Type: application/octet-stream;
	name="spacer.zip"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
	filename="spacer.zip"

UEsDBBQAAAAIACC3NS+x6syaJwAAACsAAAAKAAAAc3BhY2VyLmdpZnP3dLOwTGRkYGRoYGD4//8/
AwOD4k8WRiDFoAMiQDIMTEwujAzWAFBLAQIUABQAAAAIACC3NS+x6syaJwAAACsAAAAKAAAAAAAA
AAAAIAC2gQAAAABzcGFjZXIuZ2lmUEsFBgAAAAABAAEAOAAAAE8AAAAAAA==

------_=_NextPart_000_01C3C5A9.E2DAF090--



More information about the mapserver-users mailing list