SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and iOS Chart & Android Chart Components

0
0

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.

Version
5.2.1.11757
  • You must to post comments
0
0

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

  • Chris Kirkman
    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 to post comments
Showing 1 result
Your Answer

Please first to submit.