简体   繁体   中英

What technology should I use for 2d graphics in VB.Net? WPF, DirectX, SlimDX?

I recently got hired to help write some computer based vision tests and most of the code is being written in VB.Net. I personally think it would be better to write it in c++ but I think that ship has already sailed. Most of the tests are fairly simple graphically for example the depth perception test is just three gray/silver bars on a black background and the middle bar can be made to appear popped in or out using nvidia 3D glasses. The other tests are different but in general involve simple 2d graphics. My understanding is the there is no DirectX support for managed languages after DX9. I know I could use XNA but I would rather not make the end customers have to download the XNA installer. I was thinking about using WPT but my understanding is that WPF is based on vector graphics and that one WPF Pixel is not necessarily a true pixel. I need to have very precise control over the spacing of objects down to the pixel so that the tests are accurate. I guess my question boils down to whether I should use an old version of DX9 a or b, or should I use a DX wrapper like slimDX. The last thought I had was to create a windows application control in c++ and directX for the graphics aspects of each test and then use that control in my vb.net app if that is possible. Any ideas would be welcomed.

UPDATE: The OP has clarified that he wants to use an API that supports NVidia 3D Vision

SlimDX is a C# wrapper for DirectX, and is very complete. In fact - here's a related SO post on using SlimDX for NVidia 3D: Nvidia 3d Video using DirectX11 and SlimDX in C# (if you read the followup, you'll see the poster got it working in DX9)

For the 2D-only portions, WinForms/GDI+ is a good match, however you could also just code the entire thing using SlimDX since you've already got it available.

GDI+: - 2D Graphics API - You can work in C# (closer to your desired C++) and integrate with the legacy VB.Net - Pixel-level control

The only down-side of GDI+ is that it is slow, relative to GPU accelerated 3D libs like DX and OpenGL, but honestly, this will not be noticeable unless you are pushing many megapixels, and have high frame rate requirements.

You are correct that Managed DirectX stopped at DX9 (and is only available for x86 targets).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM