How Do I Use AlphaImageLoader with Dynamic Images?

  • Thread starter Thread starter existential.philosophy
  • Start date Start date
E

existential.philosophy

I'm trying to display dynamic, transparent PNG images in IE6.

I know how to generate dynamic images (I can already generate dynamic,
transparent PNG images for all browsers except IE6) and I know how to
use AlphaImageLoader (with it, I can display static, transparent PNG
images in IE6). When I try to put everything together, however, I just
can't get dynamic, transparent PNG images to work in IE6.

The problem, I believe, is with AlphaImageLoader. I suspect it is
using the filename extension to determine how to render the image.
Thus, a static PNG with an extension of ".png" gets recognized and
rendered properly, but a dynamic PNG with an extension of ".aspx" does
not. Am I right about that? Is there a good workaround?

The only workaround I can think of is making my images pseudo-static.
When I generate them, I could save them to the disk with a ".png"
extension, leave the files long enough for the page to read them, then
delete them. I really don't like that workaround, however, and I'm
hoping someone has found a more elegant solution. Any suggestions?

-TC
 
I'm trying to display dynamic, transparent PNG images in IE6.

I know how to generate dynamic images (I can already generate dynamic,
transparent PNG images for all browsers except IE6) and I know how to
use AlphaImageLoader (with it, I can display static, transparent PNG
images in IE6). When I try to put everything together, however, I just
can't get dynamic, transparent PNG images to work in IE6.

The problem, I believe, is with AlphaImageLoader. I suspect it is
using the filename extension to determine how to render the image.
Thus, a static PNG with an extension of ".png" gets recognized and
rendered properly, but a dynamic PNG with an extension of ".aspx" does
not. Am I right about that? Is there a good workaround?

The only workaround I can think of is making my images pseudo-static.
When I generate them, I could save them to the disk with a ".png"
extension, leave the files long enough for the page to read them, then
delete them. I really don't like that workaround, however, and I'm
hoping someone has found a more elegant solution. Any suggestions?

-TC

I found a solution, but it isn't for the faint of heart. First, I
configured my website so that .png files are processed by
aspnet_isapi.dll. Then I wrote an HTTP Module which redirects requests
for dynamic PNG images to the image-generating code which used to be
in my ASPX file, but now is a class of its own. Now, all my dynamic
PNG images look like normal ".png" files and are processed correctly
by AlphaImageLoader. Yay!

-TC
 
Just out of interest, is there a way that someone else could have your
dynamic image embedded on their own website's webpages and still get
transparency for IE 6 visitors?

I'm trying to display dynamic, transparent PNG images in IE6.

I know how to generate dynamic images (I can already generate dynamic,
transparent PNG images for all browsers except IE6) and I know how to
use AlphaImageLoader (with it, I can display static, transparent PNG
images in IE6). When I try to put everything together, however, I just
can't get dynamic, transparent PNG images to work in IE6.

The problem, I believe, is with AlphaImageLoader. I suspect it is
using the filename extension to determine how to render the image.
Thus, a static PNG with an extension of ".png" gets recognized and
rendered properly, but a dynamic PNG with an extension of ".aspx" does
not. Am I right about that? Is there a good workaround?

The only workaround I can think of is making my images pseudo-static.
When I generate them, I could save them to the disk with a ".png"
extension, leave the files long enough for the page to read them, then
delete them. I really don't like that workaround, however, and I'm
hoping someone has found a more elegant solution. Any suggestions?

-TC

I found a solution, but it isn't for the faint of heart. First, I
configured my website so that .png files are processed by
aspnet_isapi.dll. Then I wrote an HTTP Module which redirects requests
for dynamic PNG images to the image-generating code which used to be
in my ASPX file, but now is a class of its own. Now, all my dynamic
PNG images look like normal ".png" files and are processed correctly
by AlphaImageLoader. Yay!

-TC
 
Also, FWIW, I checked our site's webstats a few days ago to see of the IE
visitors, who was using IE6 and below: 27% for the last month.

We have a roundish dynamic image which we'd like to display on our client's
websites. It looks OK for IE 7+ but for <= IE6 it's giving a peach colored
area outside the circle bit (normally transparent). I thought I'd just get
by by setting that peach color to white (ASP VB.Net) but so far I haven't
been able to figure out where to set that.

I have been reading about your initial method to get transparency with <= IE
6 but it seems risky in that it may cause the graphic to be un-clickable. I
had though to just mandate that if they want the image on their site they'd
need to put it on a page that has a white background, period.

On another issue we have a graphical signature in our emails that may have
the same issue. Maybe we'd just risk a white background and no transparency
since most HTML email I've come across has a white background.



I'm trying to display dynamic, transparent PNG images in IE6.

I know how to generate dynamic images (I can already generate dynamic,
transparent PNG images for all browsers except IE6) and I know how to
use AlphaImageLoader (with it, I can display static, transparent PNG
images in IE6). When I try to put everything together, however, I just
can't get dynamic, transparent PNG images to work in IE6.

The problem, I believe, is with AlphaImageLoader. I suspect it is
using the filename extension to determine how to render the image.
Thus, a static PNG with an extension of ".png" gets recognized and
rendered properly, but a dynamic PNG with an extension of ".aspx" does
not. Am I right about that? Is there a good workaround?

The only workaround I can think of is making my images pseudo-static.
When I generate them, I could save them to the disk with a ".png"
extension, leave the files long enough for the page to read them, then
delete them. I really don't like that workaround, however, and I'm
hoping someone has found a more elegant solution. Any suggestions?

-TC

I found a solution, but it isn't for the faint of heart. First, I
configured my website so that .png files are processed by
aspnet_isapi.dll. Then I wrote an HTTP Module which redirects requests
for dynamic PNG images to the image-generating code which used to be
in my ASPX file, but now is a class of its own. Now, all my dynamic
PNG images look like normal ".png" files and are processed correctly
by AlphaImageLoader. Yay!

-TC
 
Also, FWIW, I checked our site's webstats a few days ago to see of the IE
visitors, who was using IE6 and below: 27% for the last month.

We have a roundish dynamic image which we'd like to display on our client's
websites. It looks OK for IE 7+ but for <= IE6 it's giving a peach colored
area outside the circle bit (normally transparent). I thought I'd just get
by by setting that peach color to white (ASP VB.Net) but so far I haven't
been able to figure out where to set that.

I have been reading about your initial method to get transparency with <= IE
6 but it seems risky in that it may cause the graphic to be un-clickable.I
had though to just mandate that if they want the image on their site they'd
need to put it on a page that has a white background, period.

On another issue we have a graphical signature in our emails that may have
the same issue. Maybe we'd just risk a white background and  no transparency
since most HTML email I've come across has a white background.








I found a solution, but it isn't for the faint of heart. First, I
configured my website so that .png files are processed by
aspnet_isapi.dll. Then I wrote an HTTP Module which redirects requests
for dynamic PNG images to the image-generating code which used to be
in my ASPX file, but now is a class of its own. Now, all my dynamic
PNG images look like normal ".png" files and are processed correctly
by AlphaImageLoader. Yay!

-TC

Mark,

My technique can generate a dynamic transparent PNG image with a
".png" extension that can be shared with other sites. My technique
cannot, however, guarantee that other sites will tag that image with
the AlphaImageLoader extension required to make it display properly in
IE6.

You could require your clients to use AlphaImageLoader. (You could,
for instance, suggest that they use the SuperSleight script I found
here: http://24ways.org/2007/supersleight-transparent-png-in-ie6.) Or
you could find a way to serve them an entire IMG tag, properly marked-
up, instead of just the PNG file. (I don't know how to do that...)

In any case, I guarantee that using a white background will be much
easier than supporting transparency. If the white background is
acceptable, I would go with that.

-TC
 
Back
Top