0
votes

I was trying to use Nokia's sample code to develop an app with Nokia Imaging SDK.

BackgroundVideoBrush.SetSource(_photoCaptureDevice);

here BackgroundVideoBrush is of type VideoBrush for viewfinder and _photoCaptureDevice is of type PhotoCaptureDevice. now this throws an error

"cannot convert from 'Windows.Phone.Media.Capture.PhotoCaptureDevice' to 'System.Windows.Controls.MediaElement'"

and

"The best overloaded method match for 'System.Windows.Media.VideoBrush.SetSource(System.Windows.Controls.MediaElement)' has some invalid arguments"

This code works fine in their sample code called FilterEffects and shows no error. Why is that so? how to remove this error?

nokia's sample code : http://developer.nokia.com/Resources/Library/Lumia/#!nokia-imaging-sdk/sample-projects/filter-effects.html

2

2 Answers

4
votes

I was checking my header files and noticed that i was missing using

using Microsoft.Devices;

as soon as i added that, the error is gone and VideoBrush.SetSource now has 3 overloaded function instead of one.

0
votes

According to the msdn documentation the VidoeBrush.SetSource() method takes either a System.Windows.Media.CaptureSource or System.Windows.Controls.MediaElement not a PhotoCaptureDevice.

The error is telling you there is no conversion between MediaElement and the PhotoCatpureDevice you are passing into the method.

The sample code you posted does not have the line in your question in it. Maybe you could add the relevant section to the question.