标签:
using (Graphics graphics = this.CreateGraphics()) {// graphics.Clear(Color.White); Pen pen = new Pen(Color.Red, 2); //SolidBrush brush = new SolidBrush(Color.Black); //定义一个渐变线偏转角度为30度的渐变画刷,大小40*20 LinearGradientBrush lgb = new LinearGradientBrush( new Rectangle(0, 0, 40, 20), Color.Green, Color.Blue, 45.0f); //使用偏转角度为30度的渐变画刷填充区域 graphics.FillRectangle(lgb, new Rectangle(150, 20, 120, 120)); graphics.DrawRectangle(pen, new Rectangle(150, 20, 120, 120)); }
标签:
原文地址:http://www.cnblogs.com/wjshan0808/p/4236028.html