how to change transparency of a color in c#

There is a method that does exactly what you need Color.FromArgb(int alpha, Color baseColor).

Valid alpha values are 0 through 255. Where 255 is the most opaque color and 0 a totally transparent color.

Use example

Color newColor = Color.FromArgb(newAlpha, mycolor);

I think what needs to be included among these answers is that the alpha value indicates how transparent the color is with 0 being the most transparent and with 255 being the most opaque. Here is a summary:

                     A L P H A    V A L U E
0 [<--- most transparent]  ... ... ... [most opaque --->] 255

You can set with this function

    static Color SetTransparency(int A, Color color)
    {
        return Color.FromArgb(A, color.R, color.G, color.B);
    }

Tags:

C#