Browse Source

Enable camera for Xamarin Forms WPF demo.

pull/703/head
Canming Huang 4 years ago
parent
commit
eb7761a707
  1. 7
      Emgu.CV.Example/XamarinForms/Core/ProcessAndRenderPage.cs

7
Emgu.CV.Example/XamarinForms/Core/ProcessAndRenderPage.cs

@ -72,15 +72,16 @@ namespace Emgu.CV.XamarinForms
var openCVConfigDict = CvInvoke.ConfigDict;
bool haveVideoio = (openCVConfigDict["HAVE_OPENCV_VIDEOIO"] != 0);
if (haveVideoio && (
Emgu.Util.Platform.OperationSystem == Emgu.Util.Platform.OS.Android
|| Emgu.Util.Platform.OperationSystem == Emgu.Util.Platform.OS.MacOS))
Xamarin.Forms.Device.RuntimePlatform == Xamarin.Forms.Device.Android
|| Xamarin.Forms.Device.RuntimePlatform == Xamarin.Forms.Device.macOS
|| Xamarin.Forms.Device.RuntimePlatform == Xamarin.Forms.Device.WPF))
{
#if __ANDROID__ && __USE_ANDROID_CAMERA2__
return true;
#else
if (CvInvoke.Backends.Length > 0)
{
if (Emgu.Util.Platform.OperationSystem == Emgu.Util.Platform.OS.Android)
if (Xamarin.Forms.Device.RuntimePlatform == Xamarin.Forms.Device.Android)
{
_capture = new VideoCapture(0, VideoCapture.API.Android);
}

Loading…
Cancel
Save