コード例 #1
0
ファイル: UserView.xaml.cs プロジェクト: Bosu123l/myAmbiligth
        public UserView()
        {
            InitializeComponent();
            ColorOfScreen = new List<string>();
            _timer = new Timer(150);//1000 =1s
            _timer.Elapsed += _timer_Elapsed;
            _screenCapture = new ScreenCapture();
            _colorCalculate = new ColorCalculate(_screenCapture);

            _portNames = new List<string>();
            foreach (string srt in SerialPort.GetPortNames())
            {
                _portNames.Add(srt);
            }

            _resolution = System.Windows.SystemParameters.PrimaryScreenWidth.ToString() + " x " + System.Windows.SystemParameters.PrimaryScreenHeight.ToString();
            int index = 0;

                 _portCom = new PortCom("COM5", 115200);
                _portCom.OpenPort();

            _timer.Start();
        }
コード例 #2
0
ファイル: UserView.xaml.cs プロジェクト: Bosu123l/myAmbiligth
        public UserView()
        {
            InitializeComponent();
            ColorOfScreen   = new List <string>();
            _timer          = new Timer(150);//1000 =1s
            _timer.Elapsed += _timer_Elapsed;
            _screenCapture  = new ScreenCapture();
            _colorCalculate = new ColorCalculate(_screenCapture);

            _portNames = new List <string>();
            foreach (string srt in SerialPort.GetPortNames())
            {
                _portNames.Add(srt);
            }

            _resolution = System.Windows.SystemParameters.PrimaryScreenWidth.ToString() + " x " + System.Windows.SystemParameters.PrimaryScreenHeight.ToString();
            int index = 0;

            _portCom = new PortCom("COM5", 115200);
            _portCom.OpenPort();

            _timer.Start();
        }