日期:2014-05-20 浏览次数:20855 次
private void button2_Click(object sender, EventArgs e)
{
Graphics g = this.CreateGraphics();
DrawGradient(g);
}
private void DrawGradient(Graphics g)
{
RectangleF rect = new RectangleF(0,0,1000,10);
LinearGradientBrush b = new LinearGradientBrush(rect,Color.Red,Color.Blue,LinearGradientMode.Vertical);
for (int i = 0; i < 6; i++)
{
g.FillRectangle(b, new RectangleF(0, i * 100, 1000, 10));
}
}