加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

.net – System.Windows.Media.DrawingVisual.RenderOpen()一段

发布时间:2020-12-13 20:21:33 所属栏目:Windows 来源:网络整理
导读:用例:我使用WPF来动态地覆盖网络上的图像上的文字. 解: 我正在使用DrawingVisual(包含在using语句中)的DrawingContext来绘制原始位图和重叠文本. 问题:在几个请求之后,[DrawingVisual] .RenderOpen()方法开始拒绝执行并抛出以下异常: The system cannot
用例:我使用WPF来动态地覆盖网络上的图像上的文字.

解:
我正在使用DrawingVisual(包含在using语句中)的DrawingContext来绘制原始位图和重叠文本.

问题:在几个请求之后,[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)

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读