Click to See Complete Forum and Search --> : Help with pink icons and transparency


DeepT
July 10th, 2008, 11:19 AM
I want to use some of the images in the VS2005ImageLibrary as icons for buttons (IE: I need an UP arrow). This has a variety of images and types. The .png images work just fine.

However the ones I need have the pink background which is supposed to be a transparency key. I can only achieve two effects.

1. A black arrow with a pink background on my button.

2. A black arrow on my button that has transparency, but it is transparency to my desktop. IE: You can move the form around and see through it to other applications or desktop images.

I just want the uparrow (and a few other ones) where the pink is transparent to the control it is on and no further. Does anyone know how to do this?

HanneSThEGreaT
July 10th, 2008, 11:55 AM
I think you'd need to edit the picture in an appropriate program such as FireWorks etc.
In FireWorks ( for example ), you'd need to set the pink to be transparent.
Talking under correction here, but you may have to save the picture as JPG instead.
But try editing the picture in an appropriate program, as I suggested, and see if it works :)

crackersixx
July 10th, 2008, 12:00 PM
You could use a picturebox control.

Load the image into the picturebox, setting the transparency.

Bitmap bmpPicture = (Bitmap)Bitmap.FromFile("arrow.png");
bmpPicture.MakeTransparent(Color.Pink);
pictureBox1.Image = bmpPicture;


This will work as you expect...

-C6

TheCPUWizard
July 10th, 2008, 12:19 PM
Did you try EXPLICITLY setting the color of your control to something other than "CONTROL"????

DeepT
July 10th, 2008, 03:57 PM
As to the last, the answer is yes. I tried hot pink, orange, black, and white.

As to editing the pictures, well these are the "provided" ones from Microsoft. I would assume they are ready to use. Why would they give me 200 standard icons (like the gadgets you see all over dev studio itself) and then expect you to have to edit them to make them work?

These are located:
"C:\Program Files (x86)\Microsoft Visual Studio 8\Common7\VS2005ImageLibrary"

Your path might vary, but that is the general idea. In that folder you will find a zip file with all the standard icons you see everywhere.

You can even see a lot of the hot pink icons being uses in the dev studio UI, only they are missing the hot pink part. There has to be some kind of option or value I need to set that will make them work properly.