VisionPro and C# uninstall camera

Before the project program is closed, all cameras connected to the previous link need to be uninstalled, otherwise, a pop-up error will appear when the program is closed.

To solve the error, uninstall the camera code as follows:

using System;
using System.Windows.Forms;
using Cognex.VisionPro;
using Cognex.VisionPro.ToolBlock;    

        /// <summary>
        /// 卸载相机      
        /// </summary>
        public void VisionDispose()
        {
            CogFrameGrabbers framegrabbers = new CogFrameGrabbers();
            foreach (ICogFrameGrabber fg in framegrabbers)
                fg.Disconnect(false);
        }

Learn from each other and get rich together.

Guess you like

Origin blog.csdn.net/m0_62778855/article/details/125999606