473,379 Members | 1,539 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

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

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...b;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
Nov 28 '05 #1
9 5006
IE can show alpha transparency with a very little trick.
See this for example:

http://cam70.sta.uniroma1.it/Technic...ansparency.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/

Nov 28 '05 #2
See the GDI+ FAQ article on transparent gifs.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"RCS" <rs****@gmail.com> wrote in message
news:IK*****************@newssvr33.news.prodigy.co m...
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...b;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

Nov 29 '05 #3
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?

<to**************@uniroma1.it> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
IE can show alpha transparency with a very little trick.
See this for example:

http://cam70.sta.uniroma1.it/Technic...ansparency.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/

Nov 29 '05 #4
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!

"Bob Powell [MVP]" <bob@_spamkiller_bobpowell.net> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
See the GDI+ FAQ article on transparent gifs.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"RCS" <rs****@gmail.com> wrote in message
news:IK*****************@newssvr33.news.prodigy.co m...
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...b;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


Nov 29 '05 #5
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

Nov 30 '05 #6
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

Nov 30 '05 #7
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!

<to**************@uniroma1.it> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
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

Nov 30 '05 #8
I am very happy to hear that.

greetings

tommaso

Nov 30 '05 #9
Ah, I see. Well, yes then, they are that hard...

Bob.

"RCS" <rs****@gmail.com> wrote in message
news:%Z****************@newssvr30.news.prodigy.com ...
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!

"Bob Powell [MVP]" <bob@_spamkiller_bobpowell.net> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
See the GDI+ FAQ article on transparent gifs.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"RCS" <rs****@gmail.com> wrote in message
news:IK*****************@newssvr33.news.prodigy.co m...
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...b;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



Nov 30 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Regnab | last post by:
I've got a YES/NO section of a report I'm making. Depending on certain values, I want to circle either YES or NO. I've got the code working so it'll show or hide the circle, but I can't seem to get...
1
by: Efkas | last post by:
My application have some level : 1. MyButton class with Label inheritance 2. MyComponent as User Control loading and positionning some of MyButtons 3. MyApp loading and positionning MyComponent ...
2
by: Jax | last post by:
So far i've not had much luck with this method. Bitmap.MakeTransparent(someColor); Makes the transparent colour either a non-transparent black (.bmp, jpg or .gif) or silver (.png) i've tried...
8
by: Grahammer | last post by:
Is it possible to set the background of a usercontrol as transparent? I tried setting the background image of the usercontrol to a transparent GIF, but that caused MAJOR problems. I'm making...
4
by: jcrouse | last post by:
I am using the following code to move a label on a form at runtime: If myMousedown = lblP1JoyRight.Name Then If lblP1JoyRight.BackColor.Equals(Color.Transparent) Then bTransCk = True ...
0
by: MLH | last post by:
My question is not how to paste images in Access with transparent backgrounds. I've researched 4-6 year old postings adequately describing how to achieve this. Lebans' site does a good job of...
5
by: Tony Clark | last post by:
Hi, I have a bmp that is set in a panel, i want to make the white color in the bmp image transparent so i can see the color of the panel below. How is this done? thanks tony
2
by: Lee | last post by:
Hi, I have a notify icon and have been trying to make the background color transparent. But do .ico files allow a transparent color? when i select the image for the notify icon it askes for...
11
by: Marge | last post by:
After importing a VB6 project into Express 2008 I have two gif's with transparency do not display correctly. In VB6 these pictures where used with the image object which had different properties...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.