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.
I can already get what I want with HTML5 Canvas and Javascript, using drawing commands like fillRect()
, etc.
I have taken a look at the (excessively) vast .NET documentation about this, specially System.Drawing
and System.Windows.Media
namespaces, but there seems to be so many ways to use those classes that I don't even know where to start.
A pseudocode (not actual class names!!!) example of what I plan to do would be this:
RasterImage raster = new RasterImage(width, height);
context = raster.getContext();
context.fillColor = 'white';
context.DrawRectangle(x,y,w,h);
context.saveAsPng('result.png');
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!