No rendering image if RDP is disconnected

I have a question for SfChart (WPF) exporting: 

when I use RDP (Remote Desktop) and try to export SfChart, the program works well.  I can get the correct image as expected.

But after I disconnect RDP and let the program keeps exporting images.

The exported image files will be empty(blank)... How could I fix this issue?


6 Replies

DD Devakumar Dhanapoosanam Syncfusion Team September 30, 2022 01:58 PM UTC

Hi Weichung,


Query: But after I disconnect RDP and let the program keeps exporting images. The exported image files will be empty(blank)... How could I fix this issue?


We have checked the reported query and exported the chart image by using the chart Save method, exported image renders proper at our end while chart is added in the visual tree and even when the remote desktop machine is disconnected while export. Please find the tested sample from the attachment below.


Also, we would like to let you know that chart will export as image properly when chart is added on the visual tree otherwise it will export as black image. You can export the chart to image without rendering in UI by setting the chart to RootVisual in HwndSource and passing HwndSourceParameters to the HwndSource.


Please refer below link for more details.

https://help.syncfusion.com/wpf/charts/exporting#export-sfchart-to-image-without-rendering-in-ui


Since we are not clear about the exact requirement how the remote desktop run and whether the chart is added in the visual tree during export when disconnected.


Could you please revert us by modifying the sample with issue reproduced state or share pictorial/video representation of issue with replication steps which will be helpful to provide you better solution at the earliest.


Regards,

Devakumar D


Attachment: SF_177857_4ff9daeb.zip


WE Weichung September 30, 2022 04:03 PM UTC

Hi Devakumar Dhanapoosanam,


Thanks a lot.

I tried the sample project you provided, but the test result was same. The exported images are blank.

The attachment is the screen recording video file.

The OS of remote machine is Windows 11 (build 22000.978).


BTW, I'd tried "Without UI rendering method" before, the result was same (i.e., blank image).


Maybe the issue comes from the bug of Microsoft WPF render engine.


I found such kind discussion:

System.Windows.Media.Imaging.RenderTargetBitmap.Render does not render from remote desktop · Issue #3765 · dotnet/wpf · GitHub

Some people had reported similar issues and mentioned 

"

Hi,
In Windows server datacenter 2019 version 17763.2114 there is no problem.
In Windows server datacenter 2022 version 20348.405 we got this problem.

When we connected to the user on the remote desktop everything is ok and WPF will render the views.
but when we disconnect from remote desktop, WPF cannot render the bitmap.

"



Regards,


Patrick


Attachment: 20220930_234127_4e1a2705.zip



DD Devakumar Dhanapoosanam Syncfusion Team October 3, 2022 01:55 PM UTC

Hi Weichung,


Thanks for the update.


We will validate and update the complete details in two business days on or before October 5, 2022.


Regards,

Devakumar D



DD Devakumar Dhanapoosanam Syncfusion Team October 5, 2022 10:35 AM UTC

Hi Weichung,


We were able to reproduce the reported problem when RDP is disconnected, the exported chart image is blank.


As you have already found that “Maybe the issue comes from the bug of Microsoft WPF render engine” the reported problem occurs even when export using RenderTargetBitmap getting blank while RDP is disconnected.

So, this is a framework level issue in RenderTargetBitmap and you can follow up the below reported GitHub issue link for further updates.

https://github.com/dotnet/wpf/issues/3765


Please let us know if you need any further assistance.


Regards,

Devakumar D



WE Weichung October 6, 2022 09:24 AM UTC

Hi  Devakumar,


Thanks a lot.



Regards,


Patrick Chang



DD Devakumar Dhanapoosanam Syncfusion Team October 7, 2022 05:25 AM UTC

Hi Weichung,


Thanks for your update.


Please let us know if you need any further assistance.


Regards,

Devakumar D


Loader.
Up arrow icon