473,557 Members | 2,835 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5023
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.z ip" 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.c om> wrote in message
news:IK******** *********@newss vr33.news.prodi gy.com...
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.goo glegroups.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.z ip" 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@_spamkille r_bobpowell.net > wrote in message
news:%2******** ********@TK2MSF TNGP14.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.c om> wrote in message
news:IK******** *********@newss vr33.news.prodi gy.com...
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******** *************@g 14g2000cwa.goog legroups.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.c om> wrote in message
news:%Z******** ********@newssv r30.news.prodig y.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@_spamkille r_bobpowell.net > wrote in message
news:%2******** ********@TK2MSF TNGP14.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.c om> wrote in message
news:IK******** *********@newss vr33.news.prodi gy.com...
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
1809
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 the circle (which I drew in Adobe Photoshop because I want the handwriting look) to be transparent (ie show the Yes or the No in the middle of it)....
1
20163
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 I prefer don't insert a background in MyComponent, and using the MyApp one as general background with MyComponent positionned, but I am not able...
2
2213
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 another solution with system.drawing making the selected color have a zero alpha setting (in the palette) but when the image is re-uploaded (saved as .gif)...
8
10589
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 some controls that aren't rectangular and it won't be pretty if I end up with a grey rectangle behind each one. ...
4
2544
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 lblP1JoyRight.BackColor = clrLabelMove
0
6984
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 pointing out the peculiarities (http://www.lebans.com/transparent.htm) What I'm having difficulty with is an image I've pasted in a report with a...
5
2530
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
3750
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 type .ico. now i know i can set a transparent background with png's ect, but can i use tranparent (colors) with an ico? thanks
11
4405
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 to the picturebox unfortunately there only seems to be the picturebox option in the toolbox of Express 2008? any ideas/help PLEASE :o)
0
7626
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7830
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8061
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6180
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5454
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5172
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3599
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3577
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1161
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.