C3204
2025-12-29 fec341de45f4b3fd1825807f0b3261143fa13caa
修复部分显示工具为面向对象。
已修改18个文件
269 ■■■■■ 文件已修改
LB_SmartVision/Forms/Pages/ProcessPage/AllProcessesPage.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LB_SmartVision/Forms/Pages/ProcessPage/ProcessControl.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LB_SmartVision/Forms/Pages/ProcessPage/ProcessPage.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LB_SmartVision/ProcessRun/ProcessContext.cs 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LB_SmartVision/ProcessRun/ProcessRunBll.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LB_SmartVision/VisionForm.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
LB_VisionControl/UserHSmartWindowControl.cs 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LB_VisionProcesses/Alogrithms/BaseAlgorithm/TAlgorithm.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LB_VisionProcesses/Alogrithms/BaseAlgorithm/TAlgorithmEdit.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LB_VisionProcesses/Alogrithms/BaseAlgorithm/TestTool/TestToolEdit.cs 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LB_VisionProcesses/Alogrithms/Halcon/2D/HBlobTool/HBlobToolEdit.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LB_VisionProcesses/Alogrithms/Halcon/2D/HFindCode2dTool/HFindCode2dToolEdit.cs 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LB_VisionProcesses/Alogrithms/Halcon/2D/HFindLineTool/HFindLineToolEdit.cs 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LB_VisionProcesses/Alogrithms/Halcon/2D/HFindModelTool/HFindModelToolEdit.cs 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LB_VisionProcesses/Alogrithms/Halcon/2D/HFindMultiModelTool/HFindMultiModelToolEdit.cs 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LB_VisionProcesses/Alogrithms/OpenCvSharp/BlobTool/BlobToolEdit.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LB_VisionProcesses/Alogrithms/OpenCvSharp/FindLineTool/FindLineToolEdit.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LB_VisionProcesses/Alogrithms/OpenCvSharp/FindModelTool/FindModelToolEdit.cs 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LB_SmartVision/Forms/Pages/ProcessPage/AllProcessesPage.cs
@@ -79,7 +79,7 @@
                            , this.controlsPanel.Size.Height-40);
                        processControl.Location
                            = new Point(processControl.Size.Width * index, 0);
                        if (GlobalVar.dicProcesses[name].GetImage(GlobalVar.dicLayout[i], out _, out HObject RecordImage))
                        if (GlobalVar.dicProcesses[name].GetImage(GlobalVar.dicLayout[i], out _, out HImage RecordImage))
                        {
                            dicProcessControls[title].ShowHoImage(RecordImage);
                        }
@@ -97,7 +97,7 @@
                        dicProcessControls.TryAdd(title, processControl);
                        this.controlsPanel.Controls.Add(processControl);
                        if (GlobalVar.dicProcesses[name].GetImage(GlobalVar.dicLayout[i], out _, out HObject RecordImage))
                        if (GlobalVar.dicProcesses[name].GetImage(GlobalVar.dicLayout[i], out _, out HImage RecordImage))
                        {
                            dicProcessControls[title].ShowHoImage(RecordImage);
                        }
LB_SmartVision/Forms/Pages/ProcessPage/ProcessControl.cs
@@ -81,10 +81,10 @@
        /// 异步显示图片
        /// </summary>
        /// <param name="ho_image"></param>
        public void ShowHoImage(HObject ho_image)
        public void ShowHoImage(HImage ho_image)
        {
            string str = this.lblTitle.Text;
            UserHSmartWindowControl.hImage = ho_image;
            if (this.InvokeRequired)
            {
                this.BeginInvoke(new Action(() =>
@@ -135,7 +135,7 @@
                    ClearObj();
                    result = Run(out msg);
                    if (ProcessRunBll.GetImage(_Layout, out _, out HObject RecordImage))
                    if (ProcessRunBll.GetImage(_Layout, out _, out HImage RecordImage))
                    {
                        ShowHoImage(RecordImage);
                    }
@@ -198,7 +198,7 @@
                    ProcessRunBll.LogInfo($"{ProcessRunBll.Name}运行结束,结果为:{msg}"
                        , result ? LogInfoType.PASS : LogInfoType.ERROR);
                    if (ProcessRunBll.GetImage(_Layout, out _, out HObject RecordImage))
                    if (ProcessRunBll.GetImage(_Layout, out _, out HImage RecordImage))
                    {
                        ShowHoImage(RecordImage);
                    }
LB_SmartVision/Forms/Pages/ProcessPage/ProcessPage.cs
@@ -64,7 +64,7 @@
            else
                btn_Run.ButtonType = ReaLTaiizor.Util.HopeButtonType.Danger;
            if (ProcessRunBll.GetImage(out _, out HObject RecordImage))
            if (ProcessRunBll.GetImage(out _, out HImage RecordImage))
                UserHSmartWindowControl.ShowHoImage(RecordImage);
        }
@@ -93,7 +93,7 @@
                LogInfo?.Invoke(string.Format("流程[{0}]运行完成,结果:{1}", this.ProcessRunBll.Name, msg)
                    , result ? LogInfoType.PASS : LogInfoType.ERROR);
                if (ProcessRunBll.GetImage(out _, out HObject RecordImage))
                if (ProcessRunBll.GetImage(out _, out HImage RecordImage))
                    UserHSmartWindowControl.ShowHoImage(RecordImage);
                if (result)
LB_SmartVision/ProcessRun/ProcessContext.cs
@@ -301,7 +301,7 @@
            return res;
        }
        public bool GetImage(Layout layout, out HImage InputImage, out HObject RecordImage)
        public bool GetImage(Layout layout, out HImage InputImage, out HImage RecordImage)
        {
            InputImage = null; RecordImage = null;
            try
@@ -337,9 +337,9 @@
                    else if (o_InputImage != null && o_InputImage is Bitmap)
                    {
                        //将Mat转换为HObject
                        using (HImage ho_RecordImage = TAlgorithm.Bitmap2HObject((Bitmap)o_InputImage))
                        using (HImage ho_RecordImage = TAlgorithm.Bitmap2HImage((Bitmap)o_InputImage))
                        {
                            if (ho_RecordImage != null)
                            if (ho_RecordImage != null && ho_RecordImage.Key != IntPtr.Zero)
                            {
                                InputImage = ho_RecordImage.Clone();
                            }
@@ -348,16 +348,16 @@
                    else if (o_InputImage != null && o_InputImage is Mat)
                    {
                        //将Mat转换为HObject
                        using (HImage ho_RecordImage = TAlgorithm.Mat2HObject((Mat)o_InputImage))
                        using (HImage ho_RecordImage = TAlgorithm.Mat2HImage((Mat)o_InputImage))
                        {
                            if (ho_RecordImage != null)
                            if (ho_RecordImage != null && ho_RecordImage.Key != IntPtr.Zero)
                            {
                                InputImage = ho_RecordImage.Clone();
                            }
                        }
                    }
                    if (InputImage != null && InputImage.IsInitialized())
                    if (InputImage != null && InputImage.Key != IntPtr.Zero && InputImage.IsInitialized())
                    {
                        InputImage.GetImageSize(out ho_ImageWidth, out ho_ImageHeight);
@@ -387,11 +387,13 @@
                    if (dicContext.ContainsKey(IndexProcessName))
                    {
                        ObjectRecord objectRecord1 = ((IProcess)dicContext[IndexProcessName]).Record;
                        if (objectRecord1 != null)
                        using (ObjectRecord objectRecord1 = ((IProcess)dicContext[IndexProcessName]).Record)
                        {
                            objectRecord1.Display(hWindowControl.HalconWindow);
                            objectRecord1.Dispose();
                            if (objectRecord1 != null)
                            {
                                objectRecord1.Display(hWindowControl.HalconWindow);
                                objectRecord1.Dispose();
                            }
                        }
                    }
                }
@@ -405,11 +407,13 @@
                    if (dicContext.ContainsKey(IndexProcessName))
                    {
                        ObjectRecord objectRecord2 = ((IProcess)dicContext[IndexProcessName]).Record;
                        if (objectRecord2 != null)
                        using (ObjectRecord objectRecord2 = ((IProcess)dicContext[IndexProcessName]).Record)
                        {
                            objectRecord2.Display(hWindowControl.HalconWindow);
                            objectRecord2.Dispose();
                            if (objectRecord2 != null)
                            {
                                objectRecord2.Display(hWindowControl.HalconWindow);
                                objectRecord2.Dispose();
                            }
                        }
                    }
                }
@@ -423,11 +427,13 @@
                    if (dicContext.ContainsKey(IndexProcessName))
                    {
                        ObjectRecord objectRecord3 = ((IProcess)dicContext[IndexProcessName]).Record;
                        if (objectRecord3 != null)
                        using (ObjectRecord objectRecord3 = ((IProcess)dicContext[IndexProcessName]).Record)
                        {
                            objectRecord3.Display(hWindowControl.HalconWindow);
                            objectRecord3.Dispose();
                            if (objectRecord3 != null)
                            {
                                objectRecord3.Display(hWindowControl.HalconWindow);
                                objectRecord3.Dispose();
                            }
                        }
                    }
                }
@@ -435,13 +441,13 @@
                if (Result)
                {
                    Msg = "运行成功";
                    HOperatorSet.SetColor(hWindowControl.HalconWindow, "green");
                    hWindowControl.HalconWindow.SetColor("green");
                }
                else
                    HOperatorSet.SetColor(hWindowControl.HalconWindow, "red");
                    hWindowControl.HalconWindow.SetColor("red");
                TAlgorithm.DispMsg(Msg, hWindowControl.HalconWindow, Result ? "green" : "red", 0, 0);
                HOperatorSet.DumpWindowImage(out RecordImage, hWindowControl.HalconWindow);
                RecordImage = hWindowControl.HalconWindow.DumpWindowImage();
                #endregion
                return true;
LB_SmartVision/ProcessRun/ProcessRunBll.cs
@@ -121,12 +121,12 @@
        /// </summary>
        public double RunTime = 0;
        public bool GetImage(Forms.Pages.SettingPage.Layout layout, out HImage InputImage, out HObject RecordImage)
        public bool GetImage(Forms.Pages.SettingPage.Layout layout, out HImage InputImage, out HImage RecordImage)
        {
            return ProcessContext.GetImage(layout, out InputImage, out RecordImage);
        }
        public bool GetImage(out HImage InputImage, out HObject RecordImage)
        public bool GetImage(out HImage InputImage, out HImage RecordImage)
        {
            InputImage = null;
            RecordImage = null;
LB_SmartVision/VisionForm.cs
@@ -1438,7 +1438,7 @@
                    }
                    // 生成图片并显示到控件中
                    HImage InputImage = null;
                    HObject RecordImage = null;
                    HImage RecordImage = null;
                    foreach (var layout in GlobalVar.dicLayout.Values
                                .Where(layout => layout.ProcessName == ProcessName)
LB_VisionControl/UserHSmartWindowControl.cs
@@ -32,11 +32,11 @@
        /// </summary>
        public bool bAutoSize = true;
        private HObject _hImage = null;
        private HImage _hImage = null;
        /// <summary>
        /// 显示图片(异步)
        /// </summary>
        public HObject hImage
        public HImage hImage
        {
            get
            {
@@ -273,10 +273,10 @@
        /// <param name="ho_image"></param>
        /// <param name="hWindow"></param>
        /// <param name="autoSize"></param>
        public async void ShowHoImageAsync(HObject ho_image, HWindow hWindow, bool autoSize = true)
        public async void ShowHoImageAsync(HImage ho_image, HWindow hWindow, bool autoSize = true)
        {
            if (ho_image == null || !ho_image.IsInitialized())
                HOperatorSet.ClearWindow(hWindow);
                hWindow.ClearWindow();
            else
                await ShowImageAsync(hWindow, ho_image, autoSize);
        }
@@ -286,10 +286,10 @@
        /// </summary>
        /// <param name="ho_image"></param>
        /// <param name="autoSize"></param>
        public void ShowHoImage(HObject ho_image, bool autoSize = true)
        public void ShowHoImage(HImage ho_image, bool autoSize = true)
        {
            _hImage = ho_image;
            HOperatorSet.ClearWindow(hWindowControl.HalconWindow);
            hWindowControl.HalconWindow.ClearWindow();
            if (ho_image == null)
                return;
@@ -343,7 +343,7 @@
            return;
        }
        private async Task<bool> ShowImageAsync(HWindow hWindow, HObject ho_image, bool autoSize = true)
        private async Task<bool> ShowImageAsync(HWindow hWindow, HImage ho_image, bool autoSize = true)
        {
            return await Task.Run(() =>
            {
@@ -351,7 +351,7 @@
                {
                    try
                    {
                        HOperatorSet.ClearWindow(hWindow);
                        hWindow.ClearWindow();
                    }
                    catch { return false; }
                    return true;
@@ -359,11 +359,11 @@
                try
                {
                    HOperatorSet.ClearWindow(hWindow);
                    hWindow.ClearWindow();
                    if (autoSize)
                    {
                        HOperatorSet.GetImageSize(ho_image, out HTuple imgWidth, out HTuple imgHeight);
                        ho_image.GetImageSize(out HTuple imgWidth, out HTuple imgHeight);
                        if (imgWidth.Length > 0)
                        {
                            hWindow.GetWindowExtents(out int winRow, out int winCol, out int winWidth, out int winHeight);
@@ -395,7 +395,7 @@
                        }
                    }
                    HOperatorSet.DispObj(ho_image, hWindow);
                    hWindow.DispObj(ho_image);
                }
                catch { return false; }
                return true;
@@ -421,7 +421,7 @@
            try
            {
                if (ho_object != null && ho_object.IsInitialized())
                    HOperatorSet.DispObj(ho_object, this.hWindowControl.HalconWindow);
                    this.hWindowControl.HalconWindow.DispObj(ho_object);
            }
            catch { }
        }
@@ -433,7 +433,7 @@
                if (ho_object != null && ho_object.IsInitialized())
                {
                    SetColor(color);
                    HOperatorSet.DispObj(ho_object, this.hWindowControl.HalconWindow);
                    this.hWindowControl.HalconWindow.DispObj(ho_object);
                }
            }
            catch { }
@@ -447,7 +447,7 @@
                {
                    string color = result ? "green" : "red";
                    SetColor(color);
                    HOperatorSet.DispObj(ho_object, this.hWindowControl.HalconWindow);
                    this.hWindowControl.HalconWindow.DispObj(ho_object);
                }
            }
            catch { }
@@ -488,7 +488,7 @@
                if (this.color != color)
                {
                    HOperatorSet.SetColor(this.hWindowControl.HalconWindow, color);
                    this.hWindowControl.HalconWindow.SetColor( color);
                    this.color = color;
                }
            }
LB_VisionProcesses/Alogrithms/BaseAlgorithm/TAlgorithm.cs
@@ -521,13 +521,13 @@
                return value;
        }
        public static HImage Bitmap2HObject(Bitmap bmp)
        public static HImage Bitmap2HImage(Bitmap bmp)
        {
            BitmapData srcBmpData;
            HImage image = null;
            try
            {
                if (bmp.Tag != null && bmp == null || bmp.Width == 0 || bmp.Height == 0)
                if (bmp.Tag == null || bmp == null || bmp.Width == 0 || bmp.Height == 0)
                {
                    image = null;
                    return image;
@@ -601,7 +601,7 @@
            }
        }
        public static unsafe void HObject2Bitmap(HImage hImage, out Bitmap bmp)
        public static unsafe void HImage2Bitmap(HImage hImage, out Bitmap bmp)
        {
            try
            {
@@ -685,7 +685,7 @@
            }
        }
        public static HImage Mat2HObject(Mat mat)
        public static HImage Mat2HImage(Mat mat)
        {
            HImage image = null;
            try
LB_VisionProcesses/Alogrithms/BaseAlgorithm/TAlgorithmEdit.cs
@@ -66,20 +66,20 @@
                    return;
                }
                if (InputImage is HObject)
                if (InputImage is HImage)
                {
                    inputImageHSmartWindowControl.ShowHoImage((HObject)value);
                    inputImageHSmartWindowControl.ShowHoImage((HImage)value);
                }
                else if (InputImage is Bitmap)
                {
                    using (HImage image = TAlgorithm.Bitmap2HObject((Bitmap)value))
                    using (HImage image = TAlgorithm.Bitmap2HImage((Bitmap)value))
                    {
                        inputImageHSmartWindowControl.ShowHoImage(image);
                    }
                }
                else if (InputImage is Mat)
                {
                    using (HImage image = TAlgorithm.Mat2HObject((Mat)value))
                    using (HImage image = TAlgorithm.Mat2HImage((Mat)value))
                    {
                        inputImageHSmartWindowControl.ShowHoImage(image);
                    }
LB_VisionProcesses/Alogrithms/BaseAlgorithm/TestTool/TestToolEdit.cs
@@ -89,7 +89,7 @@
                stxtInput.Text = Subject.Params.Inputs["输入"].ToString();
                if (Subject.InputImage != null && Subject.InputImage is HObject)
                    inputImageHSmartWindowControl.ShowHoImage((HObject)Subject.InputImage);
                    inputImageHSmartWindowControl.ShowHoImage((HImage)Subject.InputImage);
                Type type = Subject.Params.ROI?.GetType();
                if (Subject.Params.ROI != null)
@@ -179,21 +179,21 @@
                {
                    if (Subject.OutputImage is Mat)
                    {
                        using (HImage image = TAlgorithm.Mat2HObject((Mat)Subject.OutputImage))
                        using (HImage image = TAlgorithm.Mat2HImage((Mat)Subject.OutputImage))
                        {
                            recordImageHSmartWindowControl.ShowHoImage(image);
                        }
                    }
                    else if (Subject.OutputImage is Bitmap)
                    {
                        using (HImage image = TAlgorithm.Bitmap2HObject((Bitmap)Subject.OutputImage))
                        using (HImage image = TAlgorithm.Bitmap2HImage((Bitmap)Subject.OutputImage))
                        {
                            recordImageHSmartWindowControl.ShowHoImage(image);
                        }
                    }
                    else if (Subject.OutputImage is HObject)
                    else if (Subject.OutputImage is HImage)
                    {
                        recordImageHSmartWindowControl.ShowHoImage((HObject)Subject.OutputImage);
                        recordImageHSmartWindowControl.ShowHoImage((HImage)Subject.OutputImage);
                    }
                }
                //先判断子类再判断父类
LB_VisionProcesses/Alogrithms/Halcon/2D/HBlobTool/HBlobToolEdit.cs
@@ -216,8 +216,8 @@
                }
                catch { }
                if (Subject.InputImage != null && Subject.InputImage is HObject)
                    inputImageHSmartWindowControl.ShowHoImage((HObject)Subject.InputImage);
                if (Subject.InputImage != null && Subject.InputImage is HImage)
                    inputImageHSmartWindowControl.ShowHoImage((HImage)Subject.InputImage);
                Type type = Subject.Params.ROI?.GetType();
                if (Subject.Params.ROI != null)
@@ -308,12 +308,14 @@
                UpdataOutputs();
                imgTabControl.SelectedTab = tabPageRecordImage;
                if (Subject.InputImage != null && Subject.InputImage is HObject)
                if (Subject.InputImage != null && Subject.InputImage is HImage)
                {
                    HOperatorSet.GetImageSize((HObject)Subject.InputImage, out HTuple ho_ImageWidth, out HTuple ho_ImageHeight);
                    recordImageHSmartWindowControl.ShowHoImage((HObject)Subject.InputImage);
                    using (HImage hImage = (HImage)Subject.InputImage)
                    {
                        hImage.GetImageSize(out HTuple ho_ImageWidth, out HTuple ho_ImageHeight);
                        recordImageHSmartWindowControl.ShowHoImage(hImage);
                    }
                }
                //先判断子类再判断父类
                if (Subject.Record != null && Subject.Record is MsgRecord msgRecord)
                {
LB_VisionProcesses/Alogrithms/Halcon/2D/HFindCode2dTool/HFindCode2dToolEdit.cs
@@ -106,8 +106,13 @@
                dtxtMinCount.Text = Subject.Params.Inputs["MinCount"].ToString();
                dtxtMaxCount.Text = Subject.Params.Inputs["MaxCount"].ToString();
                if (Subject.InputImage != null && Subject.InputImage is HObject)
                    inputImageHSmartWindowControl.ShowHoImage((HObject)Subject.InputImage);
                if (Subject.InputImage != null && Subject.InputImage is HImage)
                {
                    using (HImage hImage = (HImage)Subject.InputImage)
                    {
                        inputImageHSmartWindowControl.ShowHoImage(hImage);
                    }
                }
                Type type = Subject.Params.ROI?.GetType();
                if (Subject.Params.ROI != null)
@@ -193,10 +198,13 @@
                UpdataOutputs();
                imgTabControl.SelectedTab = tabPageRecordImage;
                if (Subject.InputImage != null && Subject.InputImage is HObject)
                if (Subject.InputImage != null && Subject.InputImage is HImage)
                {
                    HOperatorSet.GetImageSize((HObject)Subject.InputImage, out HTuple ho_ImageWidth, out HTuple ho_ImageHeight);
                    recordImageHSmartWindowControl.ShowHoImage((HObject)Subject.InputImage);
                    using (HImage hImage= (HImage)Subject.InputImage)
                    {
                        hImage.GetImageSize(out HTuple ho_ImageWidth, out HTuple ho_ImageHeight);
                        recordImageHSmartWindowControl.ShowHoImage(hImage);
                    }
                }
                //先判断子类再判断父类
LB_VisionProcesses/Alogrithms/Halcon/2D/HFindLineTool/HFindLineToolEdit.cs
@@ -144,7 +144,13 @@
                cmbSelect.Text = Subject.Params.Inputs["边缘位置"].ToString();
                if (Subject.InputImage != null && Subject.InputImage is HObject)
                    inputImageHSmartWindowControl.ShowHoImage((HObject)Subject.InputImage);
                {
                    using (HImage hImage = (HImage)Subject.InputImage)
                    {
                        //hImage.GetImageSize(out HTuple ho_ImageWidth, out HTuple ho_ImageHeight);
                        inputImageHSmartWindowControl.ShowHoImage(hImage);
                    }
                }
                Type type = Subject.Params.ROI?.GetType();
                if (Subject.Params.ROI != null)
@@ -254,10 +260,13 @@
                UpdataOutputs();
                imgTabControl.SelectedTab = tabPageRecordImage;
                if (Subject.InputImage != null && Subject.InputImage is HObject)
                if (Subject.InputImage != null && Subject.InputImage is HImage)
                {
                    HOperatorSet.GetImageSize((HObject)Subject.InputImage, out HTuple ho_ImageWidth, out HTuple ho_ImageHeight);
                    recordImageHSmartWindowControl.ShowHoImage((HObject)Subject.InputImage);
                    using (HImage hImage = (HImage)Subject.InputImage)
                    {
                        hImage.GetImageSize(out HTuple ho_ImageWidth, out HTuple ho_ImageHeight);
                        recordImageHSmartWindowControl.ShowHoImage(hImage);
                    }
                }
                //先判断子类再判断父类
@@ -393,8 +402,14 @@
                    inputImageHSmartWindowControl.ClearObj();
                    if (Subject.InputImage != null && Subject.InputImage is HObject)
                        inputImageHSmartWindowControl.ShowHoImage((HObject)Subject.InputImage);
                    if (Subject.InputImage != null && Subject.InputImage is HImage)
                    {
                        using (HImage hImage = (HImage)Subject.InputImage)
                        {
                            hImage.GetImageSize(out HTuple ho_ImageWidth, out HTuple ho_ImageHeight);
                            inputImageHSmartWindowControl.ShowHoImage(hImage);
                        }
                    }
                    int hv_Elements = Convert.ToInt16(itxtCaliperCount.Text);
                    double hv_DetectHeight = Convert.ToDouble(dtxtCaliperHeight.Text);
LB_VisionProcesses/Alogrithms/Halcon/2D/HFindModelTool/HFindModelToolEdit.cs
@@ -448,9 +448,15 @@
                    }
                }
                if (Subject.InputImage != null && Subject.InputImage is HObject)
                    inputImageHSmartWindowControl.ShowHoImage((HObject)Subject.InputImage);
                if (Subject.InputImage != null && Subject.InputImage is HImage)
                {
                    using (HImage hImage = (HImage)Subject.InputImage)
                    {
                        hImage.GetImageSize(out HTuple ho_ImageWidth, out HTuple ho_ImageHeight);
                        inputImageHSmartWindowControl.ShowHoImage(hImage);
                    }
                }
                Type type = Subject.Params.ROI?.GetType();
                if (Subject.Params.ROI != null)
                {
@@ -563,10 +569,13 @@
                UpdataOutputs();
                imgTabControl.SelectedTab = tabPageRecordImage;
                if (Subject.InputImage != null && Subject.InputImage is HObject)
                if (Subject.InputImage != null && Subject.InputImage is HImage)
                {
                    HOperatorSet.GetImageSize((HObject)Subject.InputImage, out HTuple ho_ImageWidth, out HTuple ho_ImageHeight);
                    recordImageHSmartWindowControl.ShowHoImage((HObject)Subject.InputImage);
                    using (HImage hImage = (HImage)Subject.InputImage)
                    {
                        hImage.GetImageSize(out HTuple ho_ImageWidth, out HTuple ho_ImageHeight);
                        recordImageHSmartWindowControl.ShowHoImage(hImage);
                    }
                }
                //先判断子类再判断父类
@@ -1291,15 +1300,18 @@
        private void btnCreateModel_Click(object sender, EventArgs e)
        {
            if (InputImage != null && InputImage is HObject)
            if (InputImage != null && InputImage is HImage)
            {
                imgTabControl.SelectedTab = tabPageModelImage;
                HOperatorSet.GetImageSize((HObject)InputImage, out HTuple hv_imageWidth, out HTuple hv_imageHeight);
                createModelImageHSmartWindowControl.ShowHoImage((HObject)InputImage);
                createModelImageHSmartWindowControl.bAollowDraw = true;
                createModelImageHSmartWindowControl.oRoi = new HRectangle2(hv_imageWidth.TupleReal() / 2, hv_imageHeight.TupleReal() / 2
                    , 0, hv_imageWidth.TupleReal() / 4, hv_imageHeight.TupleReal() / 4);
                using (HImage hImage = (HImage)Subject.InputImage)
                {
                    hImage.GetImageSize(out HTuple hv_imageWidth, out HTuple hv_imageHeight);
                    createModelImageHSmartWindowControl.ShowHoImage(hImage);
                    createModelImageHSmartWindowControl.bAollowDraw = true;
                    createModelImageHSmartWindowControl.oRoi = new HRectangle2(hv_imageWidth.TupleReal() / 2, hv_imageHeight.TupleReal() / 2
                        , 0, hv_imageWidth.TupleReal() / 4, hv_imageHeight.TupleReal() / 4);
                }
            }
        }
LB_VisionProcesses/Alogrithms/Halcon/2D/HFindMultiModelTool/HFindMultiModelToolEdit.cs
@@ -137,9 +137,14 @@
                dtxtMinCount.Text = Subject.Params.Inputs["MinCount"].ToString();
                dtxtMaxCount.Text = Subject.Params.Inputs["MaxCount"].ToString();
                if (Subject.InputImage != null && Subject.InputImage is HObject)
                    inputImageHSmartWindowControl.ShowHoImage((HObject)Subject.InputImage);
                if (Subject.InputImage != null && Subject.InputImage is HImage)
                {
                    using (HImage hImage = (HImage)Subject.InputImage)
                    {
                        hImage.GetImageSize(out HTuple ho_ImageWidth, out HTuple ho_ImageHeight);
                        inputImageHSmartWindowControl.ShowHoImage(hImage);
                    }
                }
                Type type = Subject.Params.ROI?.GetType();
                if (Subject.Params.ROI != null)
                {
@@ -249,10 +254,13 @@
                UpdataOutputs();
                imgTabControl.SelectedTab = tabPageRecordImage;
                if (Subject.InputImage != null && Subject.InputImage is HObject)
                if (Subject.InputImage != null && Subject.InputImage is HImage)
                {
                    HOperatorSet.GetImageSize((HObject)Subject.InputImage, out HTuple ho_ImageWidth, out HTuple ho_ImageHeight);
                    recordImageHSmartWindowControl.ShowHoImage((HObject)Subject.InputImage);
                    using (HImage hImage = (HImage)Subject.InputImage)
                    {
                        hImage.GetImageSize(out HTuple ho_ImageWidth, out HTuple ho_ImageHeight);
                        recordImageHSmartWindowControl.ShowHoImage(hImage);
                    }
                }
                //先判断子类再判断父类
LB_VisionProcesses/Alogrithms/OpenCvSharp/BlobTool/BlobToolEdit.cs
@@ -120,7 +120,7 @@
                if (Subject.InputImage != null && Subject.InputImage is Mat)
                {
                    using (HImage image = TAlgorithm.Mat2HObject((Mat)Subject.InputImage))
                    using (HImage image = TAlgorithm.Mat2HImage((Mat)Subject.InputImage))
                    {
                        inputImageHSmartWindowControl.ShowHoImage(image);
                    }
@@ -216,7 +216,7 @@
                if (Subject.InputImage != null && Subject.InputImage is Mat)
                {
                    using (HImage image = TAlgorithm.Mat2HObject((Mat)Subject.InputImage))
                    using (HImage image = TAlgorithm.Mat2HImage((Mat)Subject.InputImage))
                    {
                        HOperatorSet.GetImageSize(image, out HTuple ho_ImageWidth, out HTuple ho_ImageHeight);
                        recordImageHSmartWindowControl.ShowHoImage(image);
@@ -306,7 +306,7 @@
                    HTuple hv_imageHeight = 0;
                    if (InputImage != null && InputImage is Mat)
                    {
                        using (HImage image = TAlgorithm.Mat2HObject((Mat)InputImage))
                        using (HImage image = TAlgorithm.Mat2HImage((Mat)InputImage))
                        {
                            image.GetImageSize(out hv_imageWidth, out hv_imageHeight);
                            switch (type)
LB_VisionProcesses/Alogrithms/OpenCvSharp/FindLineTool/FindLineToolEdit.cs
@@ -144,7 +144,7 @@
                if (Subject.InputImage != null && Subject.InputImage is Mat)
                {
                    using (HImage image = TAlgorithm.Mat2HObject((Mat)Subject.InputImage))
                    using (HImage image = TAlgorithm.Mat2HImage((Mat)Subject.InputImage))
                    {
                        inputImageHSmartWindowControl.ShowHoImage(image);
                        Type type = Subject.Params.ROI?.GetType();
@@ -259,7 +259,7 @@
                if (Subject.InputImage != null && Subject.InputImage is Mat)
                {
                    using (HImage image = TAlgorithm.Mat2HObject((Mat)Subject.InputImage))
                    using (HImage image = TAlgorithm.Mat2HImage((Mat)Subject.InputImage))
                    {
                        image.GetImageSize(out HTuple ho_ImageWidth, out HTuple ho_ImageHeight);
                        recordImageHSmartWindowControl.ShowHoImage(image);
@@ -346,7 +346,7 @@
                    HTuple hv_imageHeight = 0;
                    if (InputImage != null && InputImage is Mat)
                    {
                        using (HImage image=TAlgorithm.Mat2HObject((Mat)InputImage))
                        using (HImage image=TAlgorithm.Mat2HImage((Mat)InputImage))
                        {
                            image.GetImageSize(out hv_imageWidth, out hv_imageHeight);
                            switch (type)
@@ -400,7 +400,7 @@
                    if (InputImage != null && InputImage is Mat)
                    {
                        using (HImage image = TAlgorithm.Mat2HObject((Mat)InputImage))
                        using (HImage image = TAlgorithm.Mat2HImage((Mat)InputImage))
                        {
                            inputImageHSmartWindowControl.ShowHoImage(image);
                            int hv_Elements = Convert.ToInt16(itxtCaliperCount.Text);
LB_VisionProcesses/Alogrithms/OpenCvSharp/FindModelTool/FindModelToolEdit.cs
@@ -241,7 +241,7 @@
                if (Subject.InputImage != null && Subject.InputImage is Mat)
                {
                    using (HImage image = TAlgorithm.Mat2HObject((Mat)Subject.InputImage))
                    using (HImage image = TAlgorithm.Mat2HImage((Mat)Subject.InputImage))
                    {
                        inputImageHSmartWindowControl.ShowHoImage(image);
                        Type type = Subject.Params.ROI?.GetType();
@@ -359,7 +359,7 @@
                if (Subject.InputImage != null && Subject.InputImage is Mat)
                {
                    using (HImage image = TAlgorithm.Mat2HObject((Mat)Subject.InputImage))
                    using (HImage image = TAlgorithm.Mat2HImage((Mat)Subject.InputImage))
                    {
                        image.GetImageSize(out HTuple ho_ImageWidth, out HTuple ho_ImageHeight);
                        recordImageHSmartWindowControl.ShowHoImage(image);
@@ -502,7 +502,7 @@
                    HTuple hv_imageHeight = 0;
                    if (InputImage != null && InputImage is Mat)
                    {
                        using (HImage image = TAlgorithm.Mat2HObject((Mat)InputImage))
                        using (HImage image = TAlgorithm.Mat2HImage((Mat)InputImage))
                        {
                            HOperatorSet.GetImageSize(image, out hv_imageWidth, out hv_imageHeight);
                            switch (type)
@@ -1102,10 +1102,10 @@
            if (InputImage != null && InputImage is Mat)
            {
                imgTabControl.SelectedTab = tabPageModelImage;
                using (HImage hoDomainImage = TAlgorithm.Mat2HObject((Mat)InputImage))
                using (HImage hoDomainImage = TAlgorithm.Mat2HImage((Mat)InputImage))
                {
                    HOperatorSet.GetImageSize(hoDomainImage, out HTuple hv_imageWidth, out HTuple hv_imageHeight);
                    createModelImageHSmartWindowControl.ShowHoImage((HObject)hoDomainImage);
                    createModelImageHSmartWindowControl.ShowHoImage(hoDomainImage);
                    createModelImageHSmartWindowControl.bAollowDraw = true;
                    createModelImageHSmartWindowControl.oRoi = new HRectangle2(hv_imageWidth.TupleReal() / 2, hv_imageHeight.TupleReal() / 2
                        , 0, hv_imageWidth.TupleReal() / 4, hv_imageHeight.TupleReal() / 4);
@@ -1140,7 +1140,7 @@
                        using (HRegion hRectangle = new HRegion())
                        {
                            hRectangle.GenRectangle2(ROI.Row, ROI.Column, ROI.Phi, ROI.SemiLength1, ROI.SemiLength2);
                            using (HImage hoDomainImage = TAlgorithm.Mat2HObject((Mat)InputImage))
                            using (HImage hoDomainImage = TAlgorithm.Mat2HImage((Mat)InputImage))
                            {
                                HTuple hv_Channels = new HTuple();
                                //判断是否为灰度图
@@ -1205,7 +1205,7 @@
                                        //建模成功导航到子页
                                        parasTabControl.SelectedTab = tabPageRunParas;
                                        //modelImageHSmartWindowControl.ShowHoImage(((HFindModelTool)Subject).ModelID.hoImage);
                                        using (HImage modelImage = TAlgorithm.Mat2HObject(((FindModelTool)Subject).ModelID.hoImage))
                                        using (HImage modelImage = TAlgorithm.Mat2HImage(((FindModelTool)Subject).ModelID.hoImage))
                                        {
                                            modelImageHSmartWindowControl.ShowHoImage(modelImage);
                                            modelImageHSmartWindowControl.DispObj(ho_ModelContours, false);
@@ -1247,7 +1247,7 @@
                        //HOperatorSet.AffineTransContourXld(ho_ModelContours, out ho_ModelContours, hv_HomMat2D);
                        modelImageHSmartWindowControl.ClearObj();
                        using (HImage hoImage = TAlgorithm.Mat2HObject(ModelID.hoImage))
                        using (HImage hoImage = TAlgorithm.Mat2HImage(ModelID.hoImage))
                        {
                            //modelImageHSmartWindowControl.ShowHoImage(ModelID.hoImage);
                            modelImageHSmartWindowControl.ShowHoImage(hoImage);