I'm trying to develop an UserControl to make pictures using de webcam and WPF MediaKit. But when I add the
I get this error:
Could not load file or assembly 'DirectShowLib-2005, Version=126.96.36.199, Culture=neutral, PublicKeyToken=67e7b740cdfc2d3f' or one of its dependencies. The system cannot find the file specified.
I have added DirectShowLib-2005.dll and WPFMediaKit.dll to my VS2012 project and add both references. This is my XAML code:
d:DesignHeight="400" d:DesignWidth="700" Loaded="UserControl_Loaded">
<Canvas Width="320" Height="180" Background="Black">
<WPFMediaKit:VideoCaptureElement x:Name="VideoCaptureElement" Width="320" Height="180" DesiredPixelWidth="320" DesiredPixelHeight="180" FPS="30"/>
In the visual representation of the control I can read this:
Cannot create an instance of "VideoCaptureElement".
Do you know why is happening?
I have discovered the reason of the problem. In design view I get the same error, but I managed to make it run: I changed the
Target platform from Any CPU to x86.
I had the exact problem
I beat my head against the wall trying to find an alternate way to capture my webcam and every method I tried has a problem of some kind.
Finally I went back to troubleshoot the mediakit capture and realized that although I get errors in the designer- cant find DirectShowLib, it actually works fine when I run it.
I also tried changing to x386, and at one point it seemed to work but the problem returned and I haven't ben able to remedy it.
I would think that if my project references the media kit project and that project has reference to Direct Show, that I shouldn't need it in my project.
-Doesn't work with or without it.
I also tried referencing the mediakit using the compiled DLL- no difference.