Snippets
Write PNG
This is enough to create a PNG. You need to reference System.Drawing
using System.Drawing;
using System.Drawing.Imaging;
public bool SavePng(string outputfile)
{
int width = 400, height = 300;
Bitmap b = new Bitmap(width, height);
Graphics g = Graphics.FromImage(b);
g.DrawLine(Pens.Black, 0, 0, width, height);
b.Save(outputfile, ImageFormat.Png);
g.Dispose();
b.Dispose();
return true;
}