0

I have a WPF app and I want to learn to write DirectX/Direct3D code and display it in a WPF D3DImage in my app. I downloaded some sample code from http://www.codeproject.com/Articles/28526/Introduction-to-D-DImage but when I try to build it I get

The referenced component 'Microsoft.DirectX' could not be found.

...and...   

The referenced component 'Microsoft.DirectX.Direct3D' could not be found.

I assume I have to do an Add Reference to something, but what? I think I have to install a DirectX SDK but which one? (someone said WPF only goes up to 9?) and once I did that how do I use it resolve the original problem?

user316117
  • 7,971
  • 20
  • 83
  • 158
  • You may want to take a look at [WPFDXInterop](https://github.com/Microsoft/WPFDXInterop) and this [example](https://github.com/Microsoft/WPFDXInterop/blob/master/samples/D3D11Image/WpfD3D11Interop/MainWindow.xaml.cs) of how to use it. Microsoft has been working on an interop for WPF and DirectX. – Jay T Mar 30 '16 at 18:20
  • @Jay T - thanks but that looks like a very early work-in-progress and for my purposes I don't really need any of the features in DX10 or DX11. My app is a commercial program used in the aerospace industry so it needs to be pretty stable, so I'd like to just get the code working using current technology like D3DImage. I just need a working, buildable example. – user316117 Mar 30 '16 at 19:25
  • Yeah, it is still pretty new. As for using D3DImage, yes, you will need the DirectX SDK installed. I believe the [June 2010](https://www.microsoft.com/en-us/download/details.aspx?id=6812) should take care of it. – Jay T Mar 30 '16 at 20:54
  • The real question is what OS do you need to target. The DirectX SDK itself is [deprecated](https://msdn.microsoft.com/en-us/library/windows/desktop/ee663275.aspx) and has been for 6 years. These days Direct3D 11 is your most stable option as Direct3D 9 has been relegated to emulation and appcompat in modern versions of Windows. Use VS 2013 or VS 2015 with the Windows 8.1 SDK, WPFDXInterop, and the SharpDX assemblies. – Chuck Walbourn Mar 31 '16 at 07:08
  • ``Microsoft.DirectX`` and ``Microsoft.DirectX.Direct3D`` are the legacy Managed DirectX 1.1 assemblies which don't officially support .NET 4.0 or later. Use SlimDX if you want a drop-in replacement for MDX 1.1, or SharpDX if you are creating a newer project. See [DirectX and .NET](https://blogs.msdn.microsoft.com/chuckw/2010/12/09/directx-and-net/) – Chuck Walbourn Mar 31 '16 at 07:10
  • I **just** want to draw hardware accelerated lines and render them in a WPF app using D3DImage to avoid airspace issues. Our customers all use Windows 7 or 10. SlimDX appears to have been abandoned (I contacted Promit a few days ago and he says he hasn't looked at it in years) – user316117 Mar 31 '16 at 14:24

0 Answers0