Quantcast
Channel: OxyPlot (moved to GitHub)
Viewing all articles
Browse latest Browse all 2061

New Post: Printing in WPF with XPS/PrintVisual

$
0
0
Thank you for your great information!
When I try to use 2014.1.231.1 from NuGet it works fine.

I checked changing point roughly. Cause is probably in InvalidatePlot() (Plot.cs or PlotView.cs).
From following version of source code, it has not rendered if it's not receive Loaded event.

revision : 824 / change set : ffbabf441bcea4e2871c8c86fc56dbe910b3f87f [ffbabf441bce]

This modification is for performance issue.

So... I added uncool code as following it seems be working on latest version of OxyPlot.
"graph" is name of Plot object (<oxy:Plot x:Name="graph">)
    dpc.Measure(new Size(dialog.PrintableAreaWidth, dialog.PrintableAreaHeight));
    dpc.Arrange(new Rect(new Point(0, 0), dpc.DesiredSize));
    dpc.graph.RaiseEvent(new System.Windows.RoutedEventArgs(OxyPlot.Wpf.PlotView.LoadedEvent));   
    dpc.UpdateLayout();
or
    dpc.Measure(new Size(dialog.PrintableAreaWidth, dialog.PrintableAreaHeight));
    dpc.Arrange(new Rect(new Point(0, 0), dpc.DesiredSize));
    dpc.graph.IsRendering = true;
    dpc.graph.InvalidatePlot(true);
    dpc.graph.IsRendering = false;
    dpc.UpdateLayout();
Of course this is not correct way... But currently it may be only way.
It should be modified or extended for our case.

Viewing all articles
Browse latest Browse all 2061


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>