473,508 Members | 2,403 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Making image colors transparent

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
Mar 8 '06 #1
5 2524
You wouldn't. This can't be done with a Bitmap, but only with an icon or a
cursor.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer

Presuming that God is "only an idea" -
Ideas exist.
Therefore, God exists.

"Tony Clark" <To**@here.com> wrote in message
news:OG**************@TK2MSFTNGP12.phx.gbl...
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

Mar 8 '06 #2
I don't know if this is what you are after, but I would take the bitmap,
erase the white color, and give it a transparent background (PhotoShop works
nicely for this). Then you can import the new gif into the editor.

Rob K

"Tony Clark" wrote:
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

Mar 8 '06 #3
Hey Tony, if you don't mind getting your hands a little dirty with
graphics, try Paint .NET . I've been using it for a couple of weeks now
and I'm pretty happy with it. Took a little while to learn since I had
never used an imaging program before. Now that I know how to do it
though, I'm able to do a fair amount of tweaking of images without
having to send them back to the graphic arts guys I work with.

If you're trying to programmatically add in the transparency, then that
cannot be done. Good luck ~ Justin

Mar 8 '06 #4
It doesn't matter, Justin. The image is in a panel. It cannot be rendered
transparent. What he *could* do is override the Paint event that paints the
image, and draw all the white pixels the same color as the BackColor of the
Panel.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer

Presuming that God is "only an idea" -
Ideas exist.
Therefore, God exists.

"JustinC" <ju***********@gmail.com> wrote in message
news:11**********************@j33g2000cwa.googlegr oups.com...
Hey Tony, if you don't mind getting your hands a little dirty with
graphics, try Paint .NET . I've been using it for a couple of weeks now
and I'm pretty happy with it. Took a little while to learn since I had
never used an imaging program before. Now that I know how to do it
though, I'm able to do a fair amount of tweaking of images without
having to send them back to the graphic arts guys I work with.

If you're trying to programmatically add in the transparency, then that
cannot be done. Good luck ~ Justin

Mar 9 '06 #5

Tony Clark wrote:
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

This is a bit roundabout but it works for me in .NET 2.0:

1 Add an ImageList to your form.
2 Put your bmp image into your ImageList.
3 Set the image size and transparent colour (white) in your ImageList.
4 Switch to the code view and add the line below to the end of your
form's constructor:

panel1.BackgroundImage = imageList1.Images[0];

(0 is the index of your image in your ImageList)
I had to load the image in code because I could not see a way to point
the
panel background image to the ImageList in the Properties window.

The same method works for a PictureBox as well:
pictureBox1.Image = imageList1.Images[0];

In both cases the colour assigned as transparent in the ImageList was
indeed transparent.

rossum

Mar 9 '06 #6

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

Similar topics

3
3848
by: Mr. x | last post by:
Hello, I would like that my image's background color will be transparent. What I have is only paintbrush. My image is *.jpg format (I have tried to save it as *.gif format, and I got less...
1
3179
by: Spike | last post by:
Hello! Im going to make a javascript for changing alot of images. But im not sure how to do it., where to start.. Ok, first.. this is the isue. I have 3 images(I call them 1a-3a). when u...
5
6250
by: Headless | last post by:
The following code renders a visible border around the hyperlinked image using the UA's default colours for links in IE and Moz: a img{border-width:1px} <a href="foobar.html"><img...
3
18837
by: MediaDesign | last post by:
so there's the problem: my text links have background images and when I put links around images on my page, they too get the background image treatment which I do not...I have tried several...
4
3709
by: MC D | last post by:
I have a aspx page that outputs an image to the response.outputstream. This works great. However, I want to be able to make the image it outputs a .gif file. I can change the output type to...
2
2208
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...
35
2632
by: Stan Sainte-Rose | last post by:
Hi, What is the better way to save image into a database ? Just save the path into a field or save the image itself ? I have 20 000 images (~ 10/12 Ko per image ) to save. Stan
2
3747
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...
7
17035
by: mishrarajesh44 | last post by:
hii all Truly telling i hav got this code from net & i am finding error while running the code below.. code:- <?php $idir = "photo/"; // Path To Images Directory $tdir =...
0
7224
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
7323
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
7379
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...
1
7038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7493
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5625
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
4706
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...
0
3192
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...
0
1550
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.