文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>C#中渐变色的代码实例

C#中渐变色的代码实例

时间:2010-08-24  来源:明月幾時有

Graphics g = e.Graphics;
LinearGradientBrush brush = new LinearGradientBrush(this.ClientRectangle,Color.SkyBlue, Color.White, LinearGradientMode.Horizontal);

g.FillRectangle(brush, this.ClientRectangle);//画一个渐变色的块
brush.Dispose();

brush = new LinearGradientBrush(this.ClientRectangle, Color.DarkBlue, Color.White, LinearGradientMode.Horizontal);
g.DrawLine(new Pen(brush, 1), 0, 0, this.Width, 0);//渐变色线
g.DrawLine(new Pen(brush, 1), 0, this.Height-1, this.Width, this.Height-1);
brush.Dispose();
g.Dispose();

其中主要是引入LinearGradientBrush,在文件头部
using System.Drawing.Drawing2D;

相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载