Ejemplo n.º 1
0
 public override void OnOpened(CameraDevice camera)
 {
     mP.mDevice = camera;
     if (mP._TextureView != null && mP._TextureView.IsAvailable)
     {
         if (mP.mRotate)
         {
             mP.mPreviewSize   = getBestSize(mP.getSizesSupported(typeof(SurfaceTexture)), mP._TextureView.Height, mP._TextureView.Width);
             mP.mPreviewWidth  = mP.mPreviewSize.Width;
             mP.mPreviewHeight = mP.mPreviewSize.Height;
             mP.adjustAspectRatio(mP.mPreviewSize.Height, mP.mPreviewSize.Width);
         }
         else
         {
             mP.mPreviewSize   = getBestSize(mP.getSizesSupported(typeof(SurfaceTexture)), mP._TextureView.Width, mP._TextureView.Height);
             mP.mPreviewWidth  = mP.mPreviewSize.Width;
             mP.mPreviewHeight = mP.mPreviewSize.Height;
             mP.adjustAspectRatio(mP.mPreviewSize.Width, mP.mPreviewSize.Height);
         }
         mP.startPreview();
     }
 }