473,564 Members | 2,768 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 2530
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.co m> wrote in message
news:OG******** ******@TK2MSFTN GP12.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 programmaticall y 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.goo glegroups.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 programmaticall y 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.Backgrou ndImage = imageList1.Imag es[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.Ima ge = imageList1.Imag es[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
3855
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 quality), and I don't know how to make the background. In every tool I open the image (html, flash, etc...) I see the original background color, and...
1
3194
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 click on image 1a u change" image x" to image 1a when u click on image 2a u change" image x" to image 2a when u click on image 3a u change" image x" to...
5
6252
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 src="foobar.jpg" alt="foobar"></a> but not in Opera. I imagine that border colour normally defaults to transparent, but
3
18840
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 possible solutions and nothing has worked: my html code: <div class="borderCCC"> <div class="clients"><a href="../index.html"><img
4
3719
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 "image/gif" and save the image by doing: myBitmap.Save(response.outputstream,ImageFormat.Gif) and this works, BUT it uses a horrible halftone palette to...
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)...
35
2647
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
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
7
17045
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 = "photo/thumbs/"; // Path To Thumbnails Directory $twidth = "125"; // Maximum Width For Thumbnail Images
0
7665
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
7888
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. ...
1
7642
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7950
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6255
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
5484
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
5213
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
3643
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
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.