views:

138

answers:

1

A DirectX scene can be drawn inside of a WindowsFormsHost, but this solution concerns struggling with some interop issues, mainly the 'airspace' problem. Thus, before creating whole framework for this, I'd like to know, if a D3DImage used within a WPF window will cause alike problems with overlay and sizing as described in the WindowsFormsHost doc? Or is it designed to be fully compatible with WPF system? Thank you for your help.

+1  A: 

In the MSDN page D3DImage Class, you can see that D3DImage simply derives from ImageSource. So when it's used by a control like Image, it's just a source. It doesn't change the control at all, so all those nasty airspace issues are history. It also allows you to do everything you're used to being able to do to Controls, now to D3D content as well, like getting mouse events, changing opacity, and applying transforms.

It's not catch-free, however. As stated on msdn, it won't work over Remote Desktop connections and there are significant performance concerns. (Some tweaking may be needed)

If you're looking to make a DirectX heavy app like a game, I would suggest you look into using DirectX directly or using the Microsoft game development framework XNA. For more info check out the XNA Developer Center.

For any other readers, if you just want a cube on the screen or a UI with a 3d look, maybe WPF-3D is enough for your uses.

Though personally I haven't seen many projects use the D3D control, there are definitely a lot of possibilities.

Best of luck,

omdsmr
Thank you, this clears my concerns.
rook