110,539
社区成员
发帖
与我相关
我的任务
分享
private void button1_Click(object sender, EventArgs e)
{
//以不同的透明度显示图像
Graphics g = this.panel1.CreateGraphics();
g.SmoothingMode = SmoothingMode.AntiAlias;
TextureBrush MyBrush = new TextureBrush(MyBitmap);
g.FillRectangle(MyBrush, his.panel1.ClientRectangle);
for (int i = 0; i < 255; i++)
{//由透明变为不透明
g.FillRectangle(new SolidBrush(Color.FromArgb(i,Color.DarkSlateGray)), this.panel1.ClientRectangle);
System.Threading.Thread.Sleep(100);
}
}