You can create a bitmap with the size you want, then create a Graphics
object to be able to draw on the bitmap. The Clear
method is the simplest way to fill the image with a color. Then save the image using the PNG format:
using (Bitmap b = new Bitmap(50, 50)) {
using (Graphics g = Graphics.FromImage(b)) {
g.Clear(Color.Green);
}
b.Save(@"C:\green.png", ImageFormat.Png);
}