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(); }
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(); }