gpt4 book ai didi

.net - System.Windows.Media.DrawingVisual.RenderOpen() 一段时间后出错

转载 作者:行者123 更新时间:2023-12-03 20:59:25 28 4
gpt4 key购买 nike

用例:我使用 WPF 在 Web 上下文中的图像上动态叠加文本。

解决方案:
我正在使用 DrawingContext来自 DrawingVisual (包裹在 using 语句中)绘制原始位图和覆盖文本。

问题:经过几千次请求后,[DrawingVisual].RenderOpen()方法开始拒绝执行并抛出以下异常:

The system cannot find the file specified System.ComponentModel.Win32Exception UInt16 RegisterClassEx(WNDCLASSEX_D) at MS.Win32.UnsafeNativeMethods.RegisterClassEx(WNDCLASSEX_D wc_d)
at MS.Win32.HwndWrapper..ctor(Int32 classStyle, Int32 style, Int32 exStyle, Int32 x, Int32 y, Int32 width, Int32 height, String name, IntPtr parent, HwndWrapperHook[] hooks)
at System.Windows.Media.MediaContextNotificationWindow..ctor(MediaContext ownerMediaContext)
at System.Windows.Media.MediaContext..ctor(Dispatcher dispatcher)
at System.Windows.Media.MediaContext.From(Dispatcher dispatcher)
at System.Windows.Media.Visual.VerifyAPIReadWrite()
at System.Windows.Media.DrawingVisual.RenderOpen()
at ...

临时修复:对此的唯一修复是回收服务器上的 IIS 应用程序池,这可以修复问题几个小时。

问题:有人想过这个问题的原因(泄漏、线程、非托管代码等)吗?有没有其他方法可以在避免绘图视觉的图像上获取文本?也许将几何体写入位图并直接覆盖位图?

最佳答案

这是一个旧补丁 - 我会假设它包含在 .NET 4.x 中 - 但我不太确定。无论如何 - 你可以试一试。

» Discussion & Bug Report

» .NET Patch(x86)

关于.net - System.Windows.Media.DrawingVisual.RenderOpen() 一段时间后出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4716435/

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