private void startDetecting()
        {
            this.detector = new TimeredBarCodeCameraDetector();
            this.detector.NotifyCallBack += detector_CallBack;
            this.detector.Detect();
            //this.pictureBoxSignalPreview.Image = this.detector.DataIdentifier.RawData as Bitmap;

            //this.setDeviceInstance();
        }
示例#2
0
        private void toolStripMenuItemTest_Click(object sender, EventArgs e)
        {
            if (!this.processUserInputs(true))
            {
                return;
            }

            this.setControls(true);

            //this.toolStripProgressBarCurrentProgress.Value = 0;
            //this.toolStripProgressBarCurrentProgress.PerformStep();

            Action action = new Action(() =>
            {
                this.detector = new TimeredBarCodeCameraDetector();

                object[] barcodes = null;

                byte[] result = this.detector.Test(out barcodes);

                using (MemoryStream stream = new MemoryStream(result))
                {
                    this.bitmap = Bitmap.FromStream(stream) as Bitmap;
                }

                this.Invoke(new Action(() =>
                {
                    //this.toolStripProgressBarCurrentProgress.Value = 80;
                    //this.toolStripProgressBarCurrentProgress.PerformStep();

                    this.listBoxBarCodesExtracted.DataSource = barcodes;
                    this.listBoxBarCodesExtracted.Refresh();

                    this.pictureBoxSignalPreview.Image = this.bitmap;
                    this.pictureBoxSignalPreview.Refresh();

                    this.setControls(false);
                }));
            });

            //Task task = new Task(action);
            //task.Start();

            Task.Run(action);
        }
示例#3
0
 private void startDetecting()
 {
     this.detector = new TimeredBarCodeCameraDetector();
     this.detector.NotifyCallBack += detector_CallBack;
     this.detector.Detect();
 }