问题描述
halcon在.net里面自带的控件可以实现交互等很多强大的功能,但是界面并不是很好看,而且显示图像的速度比较慢,如果希望实现缩放和拖动的话,就显得不是足够流畅了.总之,由于各种原因,希望在pictureBox显示halcon处理的图像.好了,废话不多说.先上图可以显示,实现交互.其它功能请各位自行测试.现在说说方法.HTuplea,b,c,WindowHandle;HObjectcircle;privatevoidbutton1_Click(objectsender,EventArgse){HObjectimg;HTuplewidth,height;//width,height显示整个图像,类似与setpartHOperatorSet.ReadImage(outimg,@"C:UsersAdministratorDesktopa.jpg");HOperatorSet.GetImageSize(img,outwidth,outheight);//pictureBox1.Handle,获取pictureBox1的句柄HOperatorSet.OpenWindow(0,0,width,height,pictureBox1.Handle,"visible","",outWindowHandle);HOperatorSet.DispObj(img,WindowHandle);HOperatorSet.WriteString(WindowHandle,"测试成功");}//交互测试privatevoidbutton2_Click(objectsender,EventArgse){HOperatorSet.DrawCircle(WindowHandle,outa,outb,outc);HOperatorSet.GenCircle(outcircle,a,b,c);}
解决方案
解决方案二:
//pictureBox1.Handle,获取pictureBox1的句柄HOperatorSet.OpenWindow(0,0,width,height,pictureBox1.Handle,"visible","",outWindowHandle);编译时产生错误:最匹配的重载方法具有一些无郊参数。