0

I have a video playing of lines being drawn on the screen. Is it possible to create a pixel shader (for WPF) that turns newly colored pixels a certain color for N milliseconds?

That way, there can be some indication to the user to movement on the screen when the lines don't move often and the user isn't always looking at the screen.

Kev
  • 118,037
  • 53
  • 300
  • 385
Paul Knopf
  • 9,568
  • 23
  • 77
  • 142

1 Answers1

0

You can use DirectShow. Its written in unmanaged code, so you need to use this wrapper DirectShow.NET in order to use it in your C# application which is running in managed environment (samples are included, even with EVR which stands for Enhanced video Renderer which means MUCH better video quality). And when you will be passing a control handle to wrapper method for setting the video output, you need a WinForms control, because only from them you can get your desired control handle. That WinForms control you can then host in your WPF application using the WindowsFormsHost control provided for such situations when you need to use some WinForms control(s) in a WPF application. Its just theory, so i dont know if its an ultimate solution for you.

BTW: The whole idea is based on fact, that DirectShow is just some query constructed from separated filters. Renderer is a filter (EVR, VMR-7, VMR-9). Sound player is a filter. And they are connected through their pins. Its like a diagram. Electronic schema or something like that. And you can put for example Grey scale filter in there. And voila, video output will be greyscale. There is a bunch of tutorials for that. And completed simple filters as well. Unfortunately, filters must be written in C++:(

PS: I never said its gonna be easy:D

Steven
  • 99
  • 1
  • 4
  • Ya, I wanted to get around using direct show to do this, but I guess that it my only option. – Paul Knopf Jul 23 '13 at 13:27
  • According to [this](http://comments.gmane.org/gmane.comp.video.videolan.vlc.devel/74444) it seems that in VLC media player they added the shader support. [There](http://sourceforge.net/projects/libvlcnet/) you can find VLClib C# wrapper which could allow you to use even the shaders. It is better option than DirectShow, because its very easy to use and understand. So i recommend you to try vlclib first. – Steven Jul 24 '13 at 06:32
  • Maybe i found another solution. Absolutely simple solution. And you can find it [here](http://social.msdn.microsoft.com/Forums/vstudio/en-US/31e6fe44-332d-4212-bcdd-552c3178de5c/wpf-mediaplayer-class-and-pixelshader). [This](http://sourceforge.net/projects/mfnet/files/) comes as an addition to my previous comment. – Steven Jul 24 '13 at 07:09