how to change transparency of a color in c#

前端 未结 4 847
天命终不由人
天命终不由人 2021-02-12 11:38

I am using SSRS reportviewer to generate a report using objects. In my program, I am asking the user to input a string of commonly known colors such as \"Red\", \"<

4条回答
  •  孤独总比滥情好
    2021-02-12 12:03

    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);
    

提交回复
热议问题