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); } }
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); } }