请教一个GDI+绘图的问题
用GDI+绘制渐变色时,只找到一种方式,程序如下:
private void button2_Click(object sender, EventArgs e)//绘制渐变色
{
Bitmap bmp2 = new Bitmap(600, 500);
Graphics g4 = Graphics.FromImage(bmp2);
Rectangle rect = new Rectangle(0, 0, 20, 500);
Brush bru = new LinearGradientBrush(rect,Color.LightGreen,Color.Red,LinearGradientMode.Vertical);
g4.FillRectangle(bru, rect);
this.pictureBox1.CreateGraphics().DrawImage(bmp2, 0, 0);
bru.Dispose();
g4.Dispose();
}
可是这种方法只能实现两种颜色之间的渐变,现在有四种颜色,红,黄,蓝,绿,如何实现这四种颜色的渐变呢?也就是说从红色渐变到绿色,中间出现黄色和蓝色!
请大家帮帮忙。