use*_*217 6 c# transparent winforms
我已经在winforms上看到了透明背景?
它不能解决我的问题.我使用相同的方法来尝试实现透明度
public Form1()
{
this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
InitializeComponent();
this.BackColor = Color.FromArgb(0, 0, 0, 0);
}
Run Code Online (Sandbox Code Playgroud)
但这会产生灰色背景,而不是透明的.如何获得实际透明背景(注意,透明度键解决方案不提供透明背景,当我使用小于255的alpha通道绘制时,它与设置的表单背景颜色混合,而不是实际背景)?我想绘制到alpha <255的屏幕的某些区域并与背景(不是表单)混合.
Tom*_*zzo 18
我很久以前做的方法是为表单背景找到一个未使用的颜色,然后设置透明度键:
this.BackColor = Color.Magenta;
this.TransparencyKey = Color.Magenta;
Run Code Online (Sandbox Code Playgroud)
其他方式是:
[编辑]正如马里奥所说,通常键的默认透明色是洋红色.