Пример #1
0
        private void drawLatestImage(object sender, PaintEventArgs e)
        {
            if (_latestFrame != null)
            {
                // Draw the latest image from the active camera
                fillPictureBox(pictureBoxDisplay, _latestFrame);


                Bitmap current = (Bitmap)_latestFrame.Clone();

                var sw = Stopwatch.StartNew();

                BarcodeResult[] ironResults = BarcodeReader.ReadAllBarcodes(current, BarcodeEncoding.QRCode);
                if (ironResults.Length > 0)
                {
                    Console.Beep(5000, 1000);
                    foreach (var ironResult in ironResults)
                    {
                        LabelBarcodeRead.Text = ironResult.Text + ", ";
                    }
                }
                else
                {
                    LabelBarcodeRead.Text = "Nothing found " + DateTime.Now.ToShortTimeString();
                }

                Console.WriteLine(sw.ElapsedMilliseconds);
            }
        }