Ejemplo n.º 1
0
        private void btnTryOne_Click(object sender, EventArgs e)
        {
            if (CurrentVisionDevice.Camera == null)
            {
                return;
            }

            HObject img;
            HTuple  partWidth, partHigh;

            HOperatorSet.GrabImage(out img, CurrentVisionDevice.Camera);

            //------------------------------------------------------------
            // Set display
            //------------------------------------------------------------
            HOperatorSet.GetImageSize(img, out partWidth, out partHigh);
            DisplayWD.SetPart(new HTuple(0), new HTuple(0), partHigh, partWidth);
            img.DispObj(DisplayWD);
            DisplayWD.SetColor("#5f9ea080");
            DisplayWD.SetDraw("margin");
            DisplayWD.SetLineWidth(3.5);

            string codeResult = CurrentCodeReader.Run(img);

            HOperatorSet.DispObj(CurrentCodeReader.ROI, DisplayWD);
            HOperatorSet.DispText(DisplayWD, $"Kết quả : {codeResult}", new HTuple("window"),
                                  new HTuple(100), new HTuple(100), new HTuple("black"),
                                  new HTuple(), new HTuple());
        }