Ejemplo n.º 1
0
        public void OnSurfaceTextureAvailable(Android.Graphics.SurfaceTexture surface, int width, int height)
        {
            _camera = Camera.Open ();
            ConfigureCamera ();

            Preview preview = new Preview ();
            preview.OnFrame += OnPreviewFrame;
            _camera.SetPreviewCallback (preview);

            _textureView.LayoutParameters = new FrameLayout.LayoutParams (width, height);

            try {
                _camera.SetPreviewTexture (surface);
                _camera.StartPreview ();

            } catch (Exception e) {
                Console.WriteLine (e.Message);
            }
        }
Ejemplo n.º 2
0
        public void OnSurfaceTextureAvailable(Android.Graphics.SurfaceTexture surface, int width, int height)
        {
            _camera = Camera.Open();
            ConfigureCamera();

            Preview preview = new Preview();

            preview.OnFrame += OnPreviewFrame;
            _camera.SetPreviewCallback(preview);

            _textureView.LayoutParameters = new FrameLayout.LayoutParams(width, height);

            try {
                _camera.SetPreviewTexture(surface);
                _camera.StartPreview();
            } catch (Exception e) {
                Console.WriteLine(e.Message);
            }
        }