问题描述
是否可以在WPF的D3DImage中使用DirectX 10(我正在使用SlimDX)?我只能找到的唯一示例和文档是使用DX9曲面显示的.
Is it possible to use DirectX 10 (I am using SlimDX) with WPF's D3DImage? The only examples and docs I can find only show using DX9 surfaces.
推荐答案
是的,您可以在WPF中使用D3DImage使用DirectX 10、11和DirectWrite,方法是将渲染目标表面创建为共享的,然后基于DX9纹理创建在WPF中使用的共享纹理句柄上.
Yes, you can use DirectX 10, 11, and DirectWrite using the D3DImage in WPF by creating your render target surface as shared, and then creating a DX9 texture based on that shared texture handle to use in WPF.
这意味着从本质上来说,您可以像使用DX9一样使用10、11和DirectWrite,而不会产生额外的开销,也没有空域问题.
This means that essentially you can use 10, 11, and DirectWrite the same way you use DX9 with no additional overhead, and no airspace issues.
在此博客文章中可以找到带有DX9,DX10,DX11和DirectWrite集成的示例WPF项目:
A sample WPF project with DX9, DX10, DX11, and DirectWrite integration can be found referenced in this blog post here:
Microsoft代码包除了Windows 7中的各种其他非托管库之外,还包含适用于Windows 7组件(包括DX9,DX10,DX11和DirectWrite)的精简托管包装.
The Microsoft Code Pack contains a thin managed wrapper for Windows 7 components including DX9, DX10, DX11 and DirectWrite in addition to various other unmanaged libraries in Windows 7.
SurfaceQueueInteropHelper是一个WPF控件,它可以在WPF中自动创建DX9、10和11上下文,并管理D3DImage更新和渲染系统的各个方面,包括设备丢失事件.
The SurfaceQueueInteropHelper is a WPF control that manages automatically creating DX9, 10, and 11 contexts in WPF and managing D3DImage updating and various other aspects of the rendering system including device lost events.
这篇关于使用DX10的D3DImage的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!