gpt4 book ai didi

wpf - 使用 Windows 远程桌面连接时出现 OnRenderSurfaceBaseLoaded 空异常

转载 作者:可可西里 更新时间:2023-11-01 10:32:10 26 4
gpt4 key购买 nike

使用 Windows 远程桌面连接时出现 OnRenderSurfaceBaseLoaded 空异常。在 Windows 10 上的 SciChart 4.2.3.10193 和 v5.1.0.11299 上测试。下面有一篇相关帖子,但没有解决 SciChart v5.1.0.11299 上的这个问题

https://www.scichart.com/questions/question/nullreferenceexception-when-using-direct3d

Exception 1: Object reference not set to an instance of an object. 
at SciChart.Drawing.DirectX.Context.D3D10.Direct3D10RenderSurface.OnRenderSurfaceBaseLoaded(Object sender, RoutedEventArgs e)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.BroadcastEventHelper.BroadcastEvent(DependencyObject root, RoutedEvent routedEvent)
at System.Windows.BroadcastEventHelper.BroadcastLoadedEvent(Object root) at MS.Internal.LoadedOrUnloadedOperation.DoWork()
at System.Windows.Media.MediaContext.FireLoadedPendingCallbacks() at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks() at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

我们所做的更改包括调用 IRenderSurface.Dispose() 以释放源自 CustomRenderableSeries 和 LinearGradient Brush 的内存使用

如果(scs.GetValue(SciChartSurfaceBase.RenderSurfaceProperty)是 IRenderSurface renderSurface)
renderSurface.Dispose();

最佳答案

根据 SciChart's website ,应该支持远程桌面而不会出现任何崩溃。

Q: Does the DirectX Renderer Work over Remote Desktop?

A: We use D3DImage, which is a Microsoft control that allows sharing of DirectX content with WPF, avoiding airspace issues and allowing fast interop between WPF’s DirectX9 and DirectX10 rendering.

Unfortunately D3DImage has a bug, a nasty one. It won’t work over remote desktop if your application is .NET4.0! It will work over Remote Desktop on .NET4.5 and above.

Since SciChart v4 we have developed a workaround where SciChart DirectX will now work over remote desktop. This is automatic and no changes need to be applied to your code.

如果问题在最新版本(checking latest nightly from NuGet)中仍然存在,我建议打包代码重现并发送到tech support .

关于wpf - 使用 Windows 远程桌面连接时出现 OnRenderSurfaceBaseLoaded 空异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50336826/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com