Skip to content

Instantly share code, notes, and snippets.

@VisualMelon VisualMelon/Winforms
Created Sep 22, 2017

Embed
What would you like to do?
var model = new PlotModel { Title = "PNG Rendering" };
model.Axes.Add(new LinearAxis { Position = AxisPosition.Left });
model.Axes.Add(new LinearAxis { Position = AxisPosition.Bottom });
model.Series.Add(new FunctionSeries(x => x * x, 0, 1, 1000));
// export as PNG
var pngExporter = new OxyPlot.WindowsForms.PngExporter();
using (var fs = System.IO.File.Open("test.png", System.IO.FileMode.Create))
{
    pngExporter.Export(model, fs);
}
var model = new PlotModel { Title = "PNG Rendering" };
model.Axes.Add(new LinearAxis { Position = AxisPosition.Left });
model.Axes.Add(new LinearAxis { Position = AxisPosition.Bottom });
model.Series.Add(new FunctionSeries(x => x * x, 0, 1, 1000));
// export as PNG
var pngExporter = new OxyPlot.WindowsForms.PngExporter();
using (var fs = System.IO.File.Open("test.png", System.IO.FileMode.Create))
{
    pngExporter.Export(model, fs);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.