using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Euresys.Open_eVision_2_11;

namespace euresys
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        EImageBW8 EBW8Image1 = new EImageBW8(); // EImageBW8 instance
       // EWorldShape EWorldShape1 = new EWorldShape(); // EWorldShape instance
        ECircleGauge ECircleGauge1 = new ECircleGauge(); // ECircleGauge instance
        ECircle Circle1 = new ECircle(); // ECircle instance
        ECircle measuredCircle = null; // ECircle instance

        private void Form1_Load(object sender, EventArgs e)
        {
          

          

          


        }

        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                EBW8Image1.Load("C:\\temp\\b.bmp");
				//ECircleGauge1.Attach(EWorldShape1);

				EQRCodeReader EQRCode1 = new EQRCodeReader(); // EQRCodeReader instance
				EQRCode[] EQRCode1Result; // EQRCode instances



				ECircleGauge1.Dragable = true;
                ECircleGauge1.Resizable = true;
                ECircleGauge1.Rotatable = true;
                //EWorldShape1.SetSensorSize(3289, 2406);
                //EWorldShape1.Process(EBW8Image1, true);
                ECircleGauge1.Thickness = 40;
                ECircleGauge1.TransitionChoice = ETransitionChoice.NthFromEnd;
                ECircleGauge1.FilteringThreshold = 3.00f;
                ECircleGauge1.SetCenterXY(1537.00f, 1149.50f);
                ECircleGauge1.Amplitude = 360f;
                ECircleGauge1.Tolerance = 450;
                ECircleGauge1.Diameter = 1290.00f;
                ECircleGauge1.Measure(EBW8Image1);

                measuredCircle = ECircleGauge1.MeasuredCircle;
            }
            catch (EException)
            {
                // Insert exception handling code here
            }
        }

		private void button2_Click(object sender, EventArgs e)
		{
			

			EQRCodeReader EQRCode1 = new EQRCodeReader(); // EQRCodeReader instance
			EQRCode[] EQRCode1Result; // EQRCode instances
			try
			{
				EBW8Image1.Load("C:\\temp\\a.bmp");
				EQRCode1.DetectionTradeOff  =  EQRDetectionTradeOff.FavorReliability; //모든방법으로 데이터를 찾는다
				EQRCode1.TimeOut = 1000 * 1000; //timeout (1초)
				EQRCode1.SearchField = EBW8Image1;
				EQRCode1Result = EQRCode1.Read();
				EQRCode1.SearchField = EBW8Image1;
				EQRCode1Result = EQRCode1.Read();
			}
			catch (EException)
			{
				// Insert exception handling code here
			}

		}
	}
}
