SlimDX and WPF (DirectX 11)
I want to use SlimDX (DirectX 11) to render the contents of an Image in WPF.
The problem is that I can't find a way开发者_StackOverflow社区 to link the SwapChain to a D3DImage. (The DirectX 11 example uses the SlimDX RenderForm.)
Direct3D 10 and 11 are not too different in API or how they work. A SwapChain is used to present to an hWnd, not required to render. This is the same with DX10, and even the very different DX9.
In any case, this example I made should be enough to help you take your Texture2D that you render to and pass it to WPF. Don't remember if I finished the DX11, but it's pretty much the same thing. http://jmorrill.hjtcentral.com/Home/tabid/428/EntryId/437/Direct3D-10-11-Direct2D-in-WPF.aspx
You might want to go take a look a Jeremiah Morill's DirectCanvas implementation on Codeplex. He is also very helpful if you drop him a line.
Look at the WPF example in the DX10 examples. It should work about the same for DX11 I think. Because the D3DImage only works with DX9 stuff, you need to use a dx10/11 shared texture.
精彩评论