在halcon上连接相机采集了图像,之后把这个部分的cpp代码导出了,如下:
void action()
{
// Local iconic variables
HObject ho_Image;
// Local control variables
HTuple hv_AcqHandle;
//Image Acquisition 01: Code generated by Image Acquisition 01
OpenFramegrabber("USB3Vision", 0, 0, 0, 0, 0, 0, "progressive", -1, "default", -1, "false", "default", "2BA200001454_DahengImaging_MER050560U3C", 0, -1, &hv_AcqHandle);
GrabImageStart(hv_AcqHandle, -1);
while (0 != 1)
{
GrabImageAsync(&ho_Image, hv_AcqHandle, -1);
}
CloseFramegrabber(hv_AcqHandle);
}
想新建一个MFC文件,之后在串口设一个按钮,把上述代码放到按钮代码里,但是问题是怎么才能让采集到的图像显示在窗口的PictureControl控件上呢?
查阅了一些资料有的说用OpenWindow和dispobj,但是好像需要涉及到图片数据类型的转换?求大神解答