I have more than one chart in my UI, and they are on separate tabs. As soon as I call .ExportToBitmapSource() for one of the charts that is not shown (it’s tab is not selected) an exception is thrown… UIElement.Measure(availableSize) cannot be called with NaN size. Is there a way around this?
I saw yesterday in the documentation that it appears the product doesn’t support this. That would be a big bummer.
- Chris Kirkman asked 5 years ago
- last edited 5 years ago
- You must login to post comments
Hi Chris,
In WPF, when a tab is hidden, the View is actually garbage collected and destroyed – it no longer exists! So yes, we don’t support this…
SciChart however does have some mechanisms to export an image while off-screen. Again WPF doesn’t support this, so we had to do a high level of hacks and magic to make it happen. You can learn about the API to export off-screen here.
Export to BitmapSource at Specific Size
SciChart supports exporting to BitmapSource (in-memory bitmap) at a specific resolution and size….
There are also a number of caveats for exporting off-screen. We have to take a clone or copy of the entire chart in memory to achieve it. Sometimes things like styling is lost. You can read about caveats here.
Best regards,
Andrew
- Andrew Burnett-Thompson answered 5 years ago
-
Yeah, that’s not going to work. :( It’s the “caveats” that got me. I’m trying a separate method that I’ll mention in another thread.
- You must login to post comments
Please login first to submit.