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();
		}
示例#3
0
 public override void Torch(bool on)
 {
     torch = on;
     ZxingActivity.RequestTorch(on);
 }
示例#4
0
 public override void AutoFocus()
 {
     ZxingActivity.RequestAutoFocus();
 }
示例#5
0
 public override void StopScanning()
 {
     ZxingActivity.RequestCancel();
 }