在C#填充窗体为渐变颜色
2020-12-13 04:47
标签:style blog http color os art protected override void OnPaintBackground(PaintEventArgs e) //panel填充渐变背景色 在C#填充窗体为渐变颜色,搜素材,soscw.com 在C#填充窗体为渐变颜色 标签:style blog http color os art 原文地址:http://www.cnblogs.com/yuxiaoyang/p/3850380.html
2 {
3 LinearGradientBrush b = new LinearGradientBrush(this.ClientRectangle,
4 Color.Blue,Color.AliceBlue,90f); //线性渐变
5 e.Graphics.FillRectangle(b,this.ClientRectangle); // 填充窗体
6 b.Dispose(); // 释放资源
7 }
8private void panel1_Paint(object sender, PaintEventArgs e)
{
LinearGradientBrush brush = new LinearGradientBrush(e.ClipRectangle, Color.Red, Color.Blue, LinearGradientMode.Horizontal);
e.Graphics.FillRectangle(brush, e.ClipRectangle);
}
上一篇:No Spring Session store is configured: set the 'spring.session.store-type'
下一篇:python进阶资源