Beispiel #1
0
 public void setPreviewView(PreviewView previewView)
 {
     this.previewView = previewView;
     textureView      = previewView.getTextureView();
     if (surfaceTexture != null)
     {
         surfaceTexture.DetachFromGLContext();
         textureView.SurfaceTexture = surfaceTexture;
     }
     //textureView.SurfaceTextureListener(surfaceTextureListener);
 }
Beispiel #2
0
        private void setCameraType(CameraImageSource cameraImageSource)
        {
            // TODO 选择使用前置摄像头
            // cameraImageSource.getCameraControl().setCameraFacing(ICameraControl.CAMERA_FACING_FRONT);

            // TODO 选择使用usb摄像头
            cameraImageSource.getCameraControl().setCameraFacing(2);
            // 如果不设置,人脸框会镜像,显示不准
            previewView.getTextureView().ScaleX = -1;

            // TODO 选择使用后置摄像头
            //        cameraImageSource.getCameraControl().setCameraFacing(ICameraControl.CAMERA_FACING_BACK);
            //        previewView.getTextureView().setScaleX(-1);
        }
Beispiel #3
0
 public void setPreviewView(PreviewView previewView)
 {
     this.previewView = previewView;
     setTextureView(previewView.getTextureView());
 }