首页 > 其他 > 详细

渐变色背景

时间:2014-12-15 16:52:07      阅读:266      评论:0      收藏:0      [点我收藏+]

1、实现渐变色背景

bubuko.com,布布扣

 1  private void Form1_Paint(object sender, PaintEventArgs e)
 2         {
 3             Paint_Background(this.Left,this.Width,this.Height, e);
 4         }
 5 
 6         private void Paint_Background(int Left, int Width, int Height, PaintEventArgs e)
 7         {
 8             Rectangle r = new Rectangle(Left, 0, Width, Height);
 9             System.Drawing.Drawing2D.LinearGradientBrush brush =
10                 new System.Drawing.Drawing2D.LinearGradientBrush(
11                     r, 
12                     Color.FromArgb(175, 210, 255),                                //颜色1
13                     Color.White,                                                  //颜色2
14                     System.Drawing.Drawing2D.LinearGradientMode.Vertical);
15             e.Graphics.FillRectangle(brush, e.ClipRectangle);
16         }

 

渐变色背景

原文:http://www.cnblogs.com/xiaochun126/p/4164937.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!