3

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 ?

HW2015
  • 81
  • 2
  • 11
  • Very interested to hear what people say about this. By the way, what is the data format, raw 24-bit RGB ? – Kieren Johnstone Jul 23 '10 at 20:27
  • Have you tried using myImageElement.Source = BitmapSource.Create(...) 20 times per second to see how well it works? – Tergiver Jul 23 '10 at 20:53
  • @Kieren Johnstone: data is 8-bit indexed with an hardcoded colormap / palette. @Tergiver: this is what I do at the moment. And I reckon I have to call GC.Collect() manually - I would run out of RAM !!! – HW2015 Jul 24 '10 at 10:04

1 Answers1

4

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.

Jeremiah Morrill
  • 4,248
  • 2
  • 17
  • 21