public CameraPreview(Context context, Camera.IPreviewCallback previewCallback, bool cameraPreviewCallbackWithBuffer) : base(context) { _cameraPreviewCallbackWithBuffer = cameraPreviewCallbackWithBuffer; // Install a SurfaceHolder.Callback so we get notified when the // underlying surface is created and destroyed. _surfaceHolder = Holder; _surfaceHolder.AddCallback(this); _cameraPreviewCallback = previewCallback; }
public CameraPreview(Context context, Camera camera,Camera.IPreviewCallback previewCallback) : base(context) { this.camera = camera; this.previewCallback = previewCallback; var parameters = this.camera.GetParameters(); foreach (var p in from f in parameters.SupportedFocusModes where f == Camera.Parameters.FocusModeContinuousPicture select this.camera.GetParameters()) { p.FocusMode = Camera.Parameters.FocusModeContinuousPicture; this.camera.SetParameters(p); } surfaceHolder = base.Holder; surfaceHolder.AddCallback(this); }
/// <summary> /// Initializes a new instance of <see cref="CameraController"/> class. /// </summary> /// <param name="previewCallback">A preview callback method.</param> /// <param name="isFlashlightPermissionGranted">Determines that "Flashlight" permission is granted.</param> internal CameraController(Camera.IPreviewCallback previewCallback, bool isFlashlightPermissionGranted) { _previewCallbackDelegate = previewCallback; _isFlashlightPermissionGranted = isFlashlightPermissionGranted; }