LinearGradientBrush is your friend here:
Bitmap bmp = new Bitmap(Width, Height);
Graphics g = Graphics.FromImage(bmp);
LinearGradientBrush lgb = new LinearGradientBrush(new Point(0, 0), new Point(Width, Height), Color.Black, Color.Red);
g.FillRectangle(lgb, 0, 0, Width, Height);
bmp.Save("FileName");
lgb.Dispose();
g.Dispose();
bmp.Dispose();
source
share