halcon版本 18.05(可以在win10 通过OpenFramegrabber)
VS:2015
相机:大恒
电脑系统:win10
界面如下:
这里采用定时器的方法 实现实时采集
public Form1()
{
InitializeComponent();
}
HTuple hv_AcqHandle = new HTuple(), //相机句柄
hv_WindowHandle = new HTuple();//窗口句柄
HTuple hv_Width = new HTuple(), hv_Height = new HTuple();
///关闭相机
private void button3_Click(object sender, EventArgs e)
{
HOperatorSet.CloseFramegrabber(hv_AcqHandle);
timer1.Enabled = false;
}
private void timer1_Tick(object sender, EventArgs e)
{
ho_Image.Dispose();
HOperatorSet.GrabImageAsync(out ho_Image, hv_AcqHandle, -1);
if (HDevWindowStack.IsOpen())
{
HOperatorSet.DispObj(ho_Image, HDevWindowStack.GetActive());