Created
September 22, 2017 07:51
-
-
Save VisualMelon/475e3f966054d9a54e67dca44fa0754e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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