Making a transparent gif can't REALLY be this hard, can it?

R

RCS

I'm working on an ASP.NET webpage that generates an image (and am using VWD
2005 until my copy of VS2005 ships). I have done all the obvious (and
not-so-obvious) things to try to give a gif that I am generating, a
transparent background.

On the newsgroups - everyone points to this MSDN article: How to save a .gif
file with a new color table by using Visual C# .NET
http://support.microsoft.com/default.aspx?scid=kb;en-us;319061

Even though, it seems like this might be overkill - I can't compile it,
because it has an unsafe codeblock and I don't believe I can compile with
the /unsafe option with an Express product (does anyone know any
different??).

Has something been done since the early 2000's to make saving a gif with a
transparent background easier? Most articles I found were from 2001 and
2002, which makes me think this is no longer an issue?

Oh - and if I make a PNG with a transparent background, that works
perfectly, but IE does not acknowledge PNGs with transparent backgrounds and
shows grey instead. So I seem stuck between a rock and a hard place on
something I didn't expect to spend this much time on!

It's the year 2005 - surely there is some simple answer?!? Any ideas! thanks
 
T

tommaso.gastaldi

IE can show alpha transparency with a very little trick.
See this for example:

http://cam70.sta.uniroma1.it/TechnicalPreview/test/testtransparency.htm

The necessary to do the trick you can get directly from that web demo
page and the site via http.
Or else, downloading the program, inside there is a mall file
"Transparency.zip" which has all in it.
All other browser have no problems.
In any case, these tricks are all well-know things you can easily find
about googling on the web.

Greetings

Tommaso
http://cam70.sta.uniroma1.it/TechnicalPreview/
 
R

RCS

Tommaso,

I did try that .htc and tried implementing it in pieces too - no matter what
I try, pngs still show with a grey background in IE!

Any other ideas?
 
R

RCS

Bob,

Thanks for your input. The FAQ you referenced, well - that you talked about,
is what my original post was based on. After having read my original
message, do you have any other ideas? Or is your answer simply "yes,
transparent gifs -are- that hard"?

Thanks very much!
 
T

tommaso.gastaldi

That is a proven method, also recommended by the ie microsoft team.
There are absolutely no doubts it works (the demo is proof).

** Note that if the page is open on the *local* machine
IE may *block* the script for security reason. Check if there is a
message near the command bar
and in case you must allow script execution to see transparency. **

Other hints:
Check also you are actually executing the script (locally you should
get an alarm).
Check that the images are really transparent.

People visiting the page from remote will have no problem.

tommaso

PS
I suggest to forget about gif. Indexed formats are complicate with gdi
and actually png is much better and flexible...
IE7 will support alpha transp
 
T

tommaso.gastaldi

Ah, and another very crucial thing:

check that * blank.gif * is in the current directory and make
sure to use the one provided (do not temper with it).

Without blank.gif it will not work, of course.

Let me know...

tg
 
R

RCS

Tommaso,

I did finally get this working, thanks very much! And yeah, it seems like
..png is the way to go, for several reasons - but until IE fully supports it,
it's still a pain. It seems once IE7 comes out, png will completely replace
..gif

Thanks again very much!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top