private void TIMETOFAIL_Tick(object sender, EventArgs e) { if (_Debug) { return; } if (_secondcount >= _Timetofail) { Timer.Stop(); TIMETOFAIL.Stop(); DialogResult = DialogResult.Abort; } _secondcount++; }
public EmguCV_FindMatchImageViewer(int CAMERA, int ROIX, int ROIY, int ROIWidth, int ROIHeight, string ImgReference, double MatchScore, int Confidence, int Timetofail, bool Debug) { InitializeComponent(); Application.Idle += new EventHandler(Capture); _VideoCapture = new VideoCapture(CAMERA); _VideoCapture.SetCaptureProperty(CapProp.Autofocus, 39); _VideoCapture.SetCaptureProperty(CapProp.AutoExposure, 21); _Capture = _VideoCapture as ICapture; Timer.Start(); TIMETOFAIL.Start(); ROI_X = ROIX; ROI_Y = ROIY; ROI_Width = ROIWidth; ROI_Height = ROIHeight; ImgRef = ImgReference; FindMatchScore = MatchScore; _Confidence = Confidence; _Timetofail = Timetofail; _Debug = Debug; RoundApp(); }