예제 #1
0
        public void Initialize()
        {
            if (IsSourceTypeAvailable(UIImagePickerControllerSourceType.Camera))
            {
                SourceType = UIImagePickerControllerSourceType.Camera;
            }
            else
            {
                SourceType = UIImagePickerControllerSourceType.PhotoLibrary;
            }



            ShowsCameraControls   = false;
            AllowsEditing         = true;
            WantsFullScreenLayout = true;
            var tf = MonoTouch.CoreGraphics.CGAffineTransform.MakeScale(1.25f, 1.25f);               //CGAffineTransformScale(_picker.cameraViewTransform, CAMERA_TRANSFORM, CAMERA_TRANSFORM);

            CameraViewTransform = tf;

            UIView overlayView = null;

            if (Scanner.UseCustomOverlay && Scanner.CustomOverlay != null)
            {
                overlayView = Scanner.CustomOverlay;
            }

            SurfaceView = new ZxingSurfaceView(this, Scanner, this.ScanningOptions, overlayView);

            CameraOverlayView = SurfaceView;
        }
		public void Initialize()
        {
            
		    if (IsSourceTypeAvailable(UIImagePickerControllerSourceType.Camera))
                SourceType = UIImagePickerControllerSourceType.Camera;
            else
                SourceType = UIImagePickerControllerSourceType.PhotoLibrary;
			

			
            ShowsCameraControls = false;
            AllowsEditing = true;
			WantsFullScreenLayout = true;
			var tf =  MonoTouch.CoreGraphics.CGAffineTransform.MakeScale(1.25f,  1.25f); //CGAffineTransformScale(_picker.cameraViewTransform, CAMERA_TRANSFORM, CAMERA_TRANSFORM);
			CameraViewTransform = tf;

			UIView overlayView = null;

			if (Scanner.UseCustomOverlay && Scanner.CustomOverlay != null)
				overlayView = Scanner.CustomOverlay;

			SurfaceView = new ZxingSurfaceView(this, Scanner, this.ScanningOptions, overlayView);

			CameraOverlayView = SurfaceView;
        }
예제 #3
0
		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);

			this.RequestWindowFeature (WindowFeatures.NoTitle);

			this.Window.AddFlags (WindowManagerFlags.Fullscreen); //to show
			this.Window.AddFlags (WindowManagerFlags.KeepScreenOn); //Don't go to sleep while scanning

			scanner = new ZxingSurfaceView (this, ScanningOptions);
			SetContentView (scanner);

			var layoutParams = new LinearLayout.LayoutParams (ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.FillParent);

			if (!UseCustomView)
			{
				zxingOverlay = new ZxingOverlayView (this);
				zxingOverlay.TopText = TopText;
				zxingOverlay.BottomText = BottomText;

				this.AddContentView (zxingOverlay, layoutParams);
			}
			else if (CustomOverlayView != null)
			{
				this.AddContentView(CustomOverlayView, layoutParams);
			}

			OnCancelRequested += () => {
				this.CancelScan();
			};

			OnAutoFocusRequested += () => {
				this.AutoFocus();
			};

			OnTorchRequested += (bool on) => {
				this.SetTorch(on);
			};

		}
예제 #4
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            this.RequestWindowFeature(WindowFeatures.NoTitle);

            this.Window.AddFlags(WindowManagerFlags.Fullscreen);              //to show
            this.Window.AddFlags(WindowManagerFlags.KeepScreenOn);            //Don't go to sleep while scanning

            scanner = new ZxingSurfaceView(this, ScanningOptions);
            SetContentView(scanner);

            var layoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.FillParent);

            if (!UseCustomView)
            {
                zxingOverlay            = new ZxingOverlayView(this);
                zxingOverlay.TopText    = TopText;
                zxingOverlay.BottomText = BottomText;

                this.AddContentView(zxingOverlay, layoutParams);
            }
            else if (CustomOverlayView != null)
            {
                this.AddContentView(CustomOverlayView, layoutParams);
            }

            OnCancelRequested += () => {
                this.CancelScan();
            };

            OnAutoFocusRequested += () => {
                this.AutoFocus();
            };

            OnTorchRequested += (bool on) => {
                this.SetTorch(on);
            };
        }
 public ResultCallBack(ZxingSurfaceView view)
 {
     _view = view;
 }
		public ResultCallBack(ZxingSurfaceView view)
		{
			_view = view;
		}