public ZxingSurfaceView(ZxingActivity activity, ZxingScanningOptions options)
            : base(activity)
        {
            this.activity = activity;

            screenResolution = new Size(this.activity.WindowManager.DefaultDisplay.Width, this.activity.WindowManager.DefaultDisplay.Height);

            this.options = options;

            this.reader = new MultiFormatReader {
                Hints = new Hashtable {
                    //Formats to use
                    { DecodeHintType.POSSIBLE_FORMATS, this.options.GetFormats() }
                }
            };

            this.surface_holder = Holder;
            this.surface_holder.AddCallback(this);
            this.surface_holder.SetType(SurfaceType.PushBuffers);



            this.tokenSource = new System.Threading.CancellationTokenSource();
        }
		public ZxingSurfaceView (ZxingActivity activity, ZxingScanningOptions options)
			: base (activity)
		{
			this.activity = activity;

			screenResolution = new Size(this.activity.WindowManager.DefaultDisplay.Width, this.activity.WindowManager.DefaultDisplay.Height);

			this.options = options;

			this.reader = new MultiFormatReader {
				Hints = new Hashtable {
					//Formats to use
					{ DecodeHintType.POSSIBLE_FORMATS, this.options.GetFormats() }
				}
			};

			this.surface_holder = Holder;
			this.surface_holder.AddCallback (this);
			this.surface_holder.SetType (SurfaceType.PushBuffers);



			this.tokenSource = new System.Threading.CancellationTokenSource();
		}
Example #3
0
 public override void Torch(bool on)
 {
     torch = on;
     ZxingActivity.RequestTorch(on);
 }
Example #4
0
 public override void AutoFocus()
 {
     ZxingActivity.RequestAutoFocus();
 }
Example #5
0
 public override void StopScanning()
 {
     ZxingActivity.RequestCancel();
 }