title: Simple way to create an image file with drawing commands in console program
body: <p>I want to create a console program which, when run, creates an image file with some programmatically generated drawings. It will eventually read some configuration file with numeric parameters, then create the image algorithmically.</p>
  
  <p>I can already get what I want with HTML5 Canvas and Javascript, using drawing commands like <code>fillRect()</code>, etc.</p>
  
  <p>I have taken a look at the (excessively) vast .NET documentation about this, specially <code>System.Drawing</code> and <code>System.Windows.Media</code> namespaces, but there seems to be so many ways to use those classes that I don't even know where to start.</p>
  
  <p>A pseudocode (not actual class names!!!) example of what I plan to do would be this:</p>
  
  <pre><code>RasterImage raster = new RasterImage(width, height);
  context = raster.getContext();
  context.fillColor = 'white';
  context.DrawRectangle(x,y,w,h);
  context.saveAsPng('result.png');
  </code></pre>
  
  <p>I believe an actual solution would be much more verbose than this, but that is the current workflow I need to perform. Also, it would be interesting if this class could not depend too much on WPF (it's a console program), but actually use more generic drawing classes if possible. Thanks in advance!</p>