Example #1
0
            public override void DidOutputSampleBuffer(AVCaptureOutput captureOutput, CMSampleBuffer sampleBuffer, AVCaptureConnection connection)
            {
                try
                {
                    var image = ImageFromSampleBuffer(sampleBuffer);

                    // Do something with the image, we just stuff it in our main view.
                    ImageView.BeginInvokeOnMainThread(() => {
                        TryDispose(ImageView.Image);
                        ImageView.Image     = image;
                        ImageView.Transform = CGAffineTransform.MakeRotation(NMath.PI / 2);
                    });
                }
                catch (Exception e) {
                    Console.WriteLine(e);
                }
                finally {
                    sampleBuffer.Dispose();
                }
            }