/**************************************************************************/
        /* Setup the GUI for the SmartWindow application
         **************************************************************************/
        private void SmartWindowForm_Load(object sender, System.EventArgs e)
        {
            hWndControl = new HWndCtrl(viewPort);
            String fileName = "patras";
            HImage image;

            try
            {
                image   = new HImage(fileName);
            }
            catch(HOperatorException)
            {
                MessageBox.Show("Problem occured while reading file!",
                                "SmartWindow2",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Information);
                return;
            }

            hWndControl.addIconicVar(image);
            hWndControl.repaint();
        }
        /// <summary> 
        /// Defines the initial settings for the window 
        /// control. In the very beginning, the window control needs 
        /// to know the view mode of the application form to perform 
        /// the right behavior for incoming mouse events on the 
        /// HALCON window.
        /// </summary>
        private void InteractiveForm_Load(object sender, System.EventArgs e)
        {
            String fileName = "patras";
            HImage image;

            viewController = new HWndCtrl(viewPort);
            roiController  = new ROIController();
            viewController.useROIController(roiController);
            viewController.setViewState(HWndCtrl.MODE_VIEW_NONE);

            try
            {
                image   = new HImage(fileName);
            }
            catch(HOperatorException)
            {
                MessageBox.Show("Problem occured while reading file!",
                    "InteractROIForm",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Information);
                return;
            }

            viewController.addIconicVar(image);
            viewController.repaint();
        }
Exemplo n.º 3
0
        //

        public void dispObject(HObject obj)
        {
            hWndControl.addIconicVar(obj);
            hWndControl.repaint();
        }