Reputation: 81
I'm getting from our hardware device (FPGA) roughly 20 frames per second (500x500 px) and I would like to render them as fast as possible. We basically get a frame buffer every 50 msec and if my rendering is too slow - well... I'm skipping frames.
My problem is to render from a C++/CLI driver to a WPF-based application. I know it's possible to host a DirectX window in a WPF aplication. What would be the fastest solution ?
Upvotes: 3
Views: 3166
Reputation: 4268
InteropBitmap is the fastest way to update video frames. It's a bit more complicated than WriteableBitmap, but worth it for the performance.
I have an example here in one of my OSS projects. It's hard-coded for 32 RGBA, but you can modify it for 24bit.
http://silverlightviewport.codeplex.com/SourceControl/changeset/view/39341#809062
D3DImage is another fast way, but might be overkill in your situation.
Upvotes: 4