Georgiana M
Georgiana M

Reputation: 431

Why does OxyPlot.PngExporter.Export not export a .png file

I try to export an Oxyplot PlotModel to .png

I tried like so:

Stream stream = File.Create(path);
var pngExporter = new PngExporter { Width = 600, Height = 400, Background = OxyColors.White };
PngExporter.Export(this.PlotModel, stream, 800, 600);

The output file is a .File type.

enter image description here

Upvotes: 0

Views: 1182

Answers (1)

Jan-Niklas Schneider
Jan-Niklas Schneider

Reputation: 65

If the file extension is .File, it means the file is missing *.png and is therefore not readable by windows. You could try adding the file extension like this Stream stream = File.Create(path+ ".png");

Upvotes: 1

Related Questions