public void OnCameraOpened() { cameraView.PostDelayed(() => { // Disable auto-focus sound: cameraView.SetAutoFocusSound(false); // Uncomment to disable shutter sound (supported since Android 4.2+): // Please note that some devices may not allow disabling the camera shutter sound. // If the shutter sound state cannot be set to the desired value, this method will be ignored. cameraView.SetShutterSound(false); // Enable ContinuousFocus mode: cameraView.ContinuousFocus(); }, 500); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.BusinessCardsLayout); cameraView = FindViewById <ScanbotCameraView>(Resource.Id.camera); pictureCallbackDelegate = new PictureCallbackDelegate(); pictureCallbackDelegate.OnPictureTakenHandler += ProcessTakenPicture; cameraView.AddPictureCallback(pictureCallbackDelegate); cameraView.SetCameraOpenCallback(this); cameraView.SetAutoFocusSound(false); progress = FindViewById <ProgressBar>(Resource.Id.progressView); shutterButton = FindViewById <ShutterButton>(Resource.Id.snap); shutterButton.Click += delegate { cameraView.TakePicture(false); }; shutterButton.Post(delegate { shutterButton.ShowAutoButton(); }); sdk = new IO.Scanbot.Sdk.ScanbotSDK(this); var detector = sdk.MultipleObjectsDetector(); if (modParams != null) { detector.SetParams(modParams); } var handler = MultipleObjectsFrameHandler.Attach(cameraView, detector); var polygon = FindViewById <MultiplePolygonsView>(Resource.Id.polygonView); handler.AddResultHandler(new MultipleObjectsCallback()); FindViewById(Resource.Id.flash).Click += delegate { flashEnabled = !flashEnabled; cameraView.UseFlash(flashEnabled); }; }