Page 1 of 1

Main UI app freeze when I try generation of a set of bitmap images from the chart content by using Headless Rendering

Posted: Tue May 04, 2021 1:44 pm
by chistyk
I have two charts on the main screen and I want to generate a set of images from the booth of charts in the background mode, show the user the waiting popup. When I run the process main UI not responding. I don't want the to user see this freeze. Could you give me some advice on the better way to implement what I want?
Please find my sample app.
Thank you for any help.

Re: Main UI app freeze when I try generation of a set of bitmap images from the chart content by using Headless Renderin

Posted: Fri May 14, 2021 2:05 pm
by ArctionKestutis
Sample application is a little bit confusing and I don't have DevExpress libraries to debug it properly.
Here will just outline things you should take care or be aware.
Normal Chart should be rendered (properties modified in main UI Thread). You can do the thick by creating several window in application with its own thread, and add chart to each of them. This is demonstrated in project/topic here.
In contrast, LightningChart in Headless mode (as you are trying to use) could be rendered in background thread. It is only important that Headless chart should be updated in the same thread it was created. It seems to me that LCRunner.GenerateImages() method is using application main UI Thread. Therefore, there is no benefit of using Parallel loops and Task.Factory.
Hope this helps.