public JPTCG.Vision.HalconInspection.RectData FindCircleCenter(double caliValues, HWindowControl hWin) { MachineVision Mc = new MachineVision(); _result result = new _result(); if (Para.MachineOnline) { //if mhalcon_image2 myImage = BaslerCam.mhalcon_image2; } HTuple hv_High, hv_width; HOperatorSet.GetImageSize(myImage, out hv_width, out hv_High); HOperatorSet.SetPart(hWin.HalconWindow, 0, 0, hv_High, hv_width); myImage.DispObj(hWin.HalconWindow); result = Mc.Analys(myImage, hWin); JPTCG.Vision.HalconInspection.RectData myResult = new JPTCG.Vision.HalconInspection.RectData(); if (myImage == null) { return(myResult); } myResult.X = result.centerX; myResult.Y = result.centerY; if (myResult.X != 0.0 && myResult.Y != 0.00) { myResult.Found = true; } else { myResult.Found = false; } return(myResult); }
private void ShowFullScreenVision_Click(object sender, RoutedEventArgs e) { StopCapture(); if (_fullScreenWindow != null) { _fullScreenWindow.BringIntoView(); } else { _fullScreenWindow = new MachineVision(ViewModel.Machine); _fullScreenWindow.Closed += _fullScreenWindow_Closed; _fullScreenWindow.Show(); } }
private void _fullScreenWindow_Closed(object sender, EventArgs e) { _fullScreenWindow = null; }