From the documentation on the OxyPlot Documentation Website it says that it uses a class PngExporter. This class no longer exists in OxyPlot, but there are classes called PngEncoderand PngDecoder. I suspect that the equivalent method PngExporter.Exportis equal PngEncoder.Encode, but it requests a 2d array from OxyColor, called "pixels", but I don't know where to get this data.
NOTE: Exporting to SVG or PDF works, but this form is useless.
Problem: I need to export PNG from code only PlotModelto OxyPlot, but the documentation is out of date.
This is the code I was told to use:
using (var stream = File.Create(fileName))
{
var pngExporter = new PngExporter();
pngExporter.Export(plotModel, stream, 600, 400, Brushes.White);
}
source
share