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