功能实现:winform界面开发中添加多个pictureBox控件用于显示图片,通过halcon的DispObj方法展示图片
问题描述:通过主窗口传递多个图片到子界面并显示图片,结果图片显示一段时间后会自动刷新为空白
代码:
HTuple m_Window = new HTuple();
HOperatorSet.OpenWindow(0, 0, pic.Width, pic.Height, pic.Handle, "visible", "", out m_Window);
HTuple ht_row1, ht_col1, ht_row2, ht_col2;
HObject tempRegion;
HOperatorSet.SelectObj(m_hoLetters, out tempRegion, i + 1);
HOperatorSet.SmallestRectangle1(tempRegion, out ht_row1, out ht_col1, out ht_row2, out ht_col2);
double width = ht_col2.I - ht_col1.I;
double hight = ht_row2.I - ht_row1.I;
if (width / hight < whRadio)
{
double diff