473,406 Members | 2,371 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,406 software developers and data experts.

How to make a color transparent? - need help

I have here a specific problem with ASP.NET in C#. I want to convert an Icon
(System.Drawing.Icon icon) to a GIF-Image.

First, my attempt was converting the icon to a Bitmap:

Bitmap bmp = icon.ToBitmap();

Then save this Bitmap as a GIF-Image:

bmp.Save("mypic.gif",ImageFormat.Gif);

OK, this works but when I load the new GIF-Image into my Browser, the
defined transparent color is black.

My second attempt was to define the color in the Bitmap manually as
transparent.

Bitmap bmp = icon.ToBitmap();
bmp.MakeTransparent(bmp.GetPixel(0,0));
bmp.Save("mypic.gif",ImageFormat.Gif);

So I was in big hope, but this also doesn't work. Has anybody an idea, how i
can manage this?

Thanks a lot!!

Nov 18 '05 #1
0 1332

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

Similar topics

5
by: Paul Schnitter | last post by:
Update: My custom control is based on the article "Creating Visual Basic .NET controls from scratch" in "Adventures in .NET" on MSDN. It is designed to be a replacement for the VB6 shape...
8
by: Susan Bricker | last post by:
Is there a way to change the background color of command buttons? I know that I saw some VBA code somewhere that showed how to do this. I think it involved making the button transparent and then...
3
by: Ignacio Domínguez | last post by:
Hi there. I know I can make a form transparent by setting the transparent color, opacity, etc. Is there a way of making the background of a label and the background of a picturebox transparent...
7
by: Chuck | last post by:
I am working in C# 2003. Can anyone tell me how to make a user control transparent. VS help doesn't help. What I want to do is draw on a user control during design time and then place the...
1
by: Daimy | last post by:
Can not make a control transparent in XP. Please help me. Thanks! public class Class1 : System.Windows.Forms.CheckBox {
1
by: Chris Auer | last post by:
I have been banging my head for a couple of hours now. No matter what I do the color that I make transparent is black. Here is the code I am using from MSDN. I have tried bitmaps, jpegs, gifs and...
2
by: anthonymelillo | last post by:
Is there a way to make the background of a text label transparent so that the image on the form behind can show through ? I can only seem to find out how to make the text background a color. ...
1
by: active | last post by:
I have a UserControl that contains two pictureboxes. One on top of the other. The top one is smaller then the bottom one. The top one is to be transparent. I want to draw on it and then sometimes...
2
by: kishkin | last post by:
Hello everybody! I just want to make window transparent. ;) At this moment I've found only ideas of taking screenshots to make background... Anything else? Thanks for help!
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
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,...
0
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,...
0
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,...
0
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...

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.