Closed colejohnson66 closed 2 years ago
On closer inspection, I think the issue is just that we are not setting the resolution of the final bitmap. Line 121 of PngParser should be
var bmp = new RenderTargetBitmap(new PixelSize(Width, Height), new Vector(Resolution, Resolution));
Yes, that fixed it! I made a PR to fix the issue: oxyplot/oxyplot-avalonia#45
I am attempting to export a chart to a PNG for inclusion in a PDF, so I need a resolution of 300+ dpi, not 96. My attempt to do so is this:
My issue is that the saved PNG file is 1400x800, but the actual rendering of the chart is 700x400 and shoved in the top-left corner.
Some digging seems to suggest this is related to Skia as the documentation for
Avalonia.Media.Imaging.IBitmap.Dpi
says:@VisualMelon suggests that this is actually a problem in Avalonia's implementation of the render code, specifically: