1.打开对话框读取单张图
dev_open_file_dialog
2.图像显示不全
解决方案: HOperatorSet.SetPart(HTuple windowHandle, HTuple row1, HTuple column1, HTuple row2, HTuple column2)
windowHandle:窗体
HTuple row1, HTuple column1,:左上角的行列坐标
HTuple row2, HTuple column2:右下角的行列坐标
hv_Width.Dispose(); hv_Height.Dispose();
HOperatorSet.GetImageSize(ho_Image, out hv_Width, out hv_Height);//获取图像的宽高
//显示**所在区域
HOperatorSet.SetDraw(hWindowControl1.HalconWindow, "margin");
HOperatorSet.SetLineWidth(hWindowControl1.HalconWindow, 3);
HOperatorSet.SetPart(hWindowControl1.HalconWindow, 0, 0, hv_Width, hv_Height);
效果: